Hi, On Tue, Jul 07, 2015 at 04:25:00PM +0100, Rui Miguel Silva wrote: > When processing urb list in dummy_timer and an ep goes away, the urb > is giveback with an -EPROTO error. However the same urb can be > enqueued once again and the loop in dummy_timer never get out. > > To fix that, make sure the dummy_hcd is enabled at enqueue time to > avoid adding urb to the urbp list. > > Signed-off-by: Rui Miguel Silva <rui.silva@xxxxxxxxxx> > --- > drivers/usb/gadget/udc/dummy_hcd.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c > index f5400b8..30f1563 100644 > --- a/drivers/usb/gadget/udc/dummy_hcd.c > +++ b/drivers/usb/gadget/udc/dummy_hcd.c > @@ -926,8 +926,6 @@ static int dummy_udc_stop(struct usb_gadget *g) > return 0; > } > > -#undef is_enabled > - > /* The gadget structure is stored inside the hcd structure and will be > * released along with it. */ > static void init_dummy_udc_hw(struct dummy *dum) > @@ -1157,6 +1155,10 @@ static int dummy_urb_enqueue( > urbp->miter_started = 0; > > dum_hcd = hcd_to_dummy_hcd(hcd); > + if (!is_enabled(dum_hcd)) { is_enabled() is for use by the gadget side. Also, there should be no problems in queueing the URB, it just shouldn't start. -- balbi
Attachment:
signature.asc
Description: Digital signature