The disconnect code is scheduled in a tasklet. I don't see the point in doing this and the comment says that we may want do this in the irq. This patch is doing so. Cc: Thomas Dahlmann <dahlmann.thomas@xxxxxxxx> Signed-off-by: Sebastian Andrzej Siewior <sebastian@xxxxxxxxxxxxx> --- drivers/usb/gadget/amd5536udc.c | 22 +++------------------- 1 files changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index e9a2c5c..f0a05e3 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c @@ -64,8 +64,7 @@ /* udc specific */ #include "amd5536udc.h" - -static void udc_tasklet_disconnect(unsigned long); +static void udc_tasklet_disconnect(struct udc *dev); static void empty_req_queue(struct udc_ep *); static int udc_probe(struct udc *dev); static void udc_basic_init(struct udc *dev); @@ -133,11 +132,6 @@ static struct timer_list udc_pollstall_timer; static int stop_pollstall_timer; static DECLARE_COMPLETION(on_pollstall_exit); -/* tasklet for usb disconnect */ -static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, - (unsigned long) &udc); - - /* endpoint names used for print */ static const char ep0_string[] = "ep0in"; static const char *ep_string[] = { @@ -1647,22 +1641,14 @@ static void usb_disconnect(struct udc *dev) /* mask interrupts */ udc_mask_unused_interrupts(dev); - /* REVISIT there doesn't seem to be a point to having this - * talk to a tasklet ... do it directly, we already hold - * the spinlock needed to process the disconnect. - */ - - tasklet_schedule(&disconnect_tasklet); + udc_tasklet_disconnect(dev); } -/* Tasklet for disconnect to be outside of interrupt context */ -static void udc_tasklet_disconnect(unsigned long par) +static void udc_tasklet_disconnect(struct udc *dev) { - struct udc *dev = (struct udc *)(*((struct udc **) par)); u32 tmp; DBG(dev, "Tasklet disconnect\n"); - spin_lock_irq(&dev->lock); if (dev->driver) { spin_unlock(&dev->lock); @@ -1695,8 +1681,6 @@ static void udc_tasklet_disconnect(unsigned long par) tmp = AMD_ADDBITS(tmp, UDC_DEVCFG_SPD_FS, UDC_DEVCFG_SPD); writel(tmp, &dev->regs->cfg); } - - spin_unlock_irq(&dev->lock); } /* Reset the UDC core */ -- 1.7.8.3 -- 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