On Thu, Oct 29, 2015 at 02:53:46PM +0100, Krzysztof Opasiak wrote: > > > On 10/29/2015 10:36 AM, Peter Chen wrote: > >Hi, > > > >It is due to try to allocate memory with GFP_KERNEL at ISR, below change > >can fix it, if not better solution, I can submit a patch. > > > >diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c > >index 6b2102b..d2524a1 100644 > >--- a/drivers/usb/gadget/function/f_loopback.c > >+++ b/drivers/usb/gadget/function/f_loopback.c > >@@ -329,7 +329,7 @@ static int alloc_requests(struct usb_composite_dev *cdev, > > for (i = 0; i < loop->qlen && result == 0; i++) { > > result = -ENOMEM; > > > >- in_req = usb_ep_alloc_request(loop->in_ep, GFP_KERNEL); > >+ in_req = usb_ep_alloc_request(loop->in_ep, GFP_ATOMIC); > > if (!in_req) > > Well... I didn't get this error on my hardware (odroid u3+) and my > "other hardware" (dummy_hcd) but agree. This function is called from > set_alt() and this may be called in interrupt ctx so this should use > GFP_ATOMIC as you suggested. > Ok, then do I need to add "Cc: <stable@xxxxxxxxxxxxxxx> # 3.18+" like yours, I am not sure if your patch has already been in stable tree or not. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html