Replace usb_gadget_driver's disconnect with udc-core's reset notifier at bus reset handler. Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxx> --- drivers/usb/gadget/udc/fsl_udc_core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 75b23ea..a59d37c 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -1774,7 +1774,7 @@ static void bus_resume(struct fsl_udc *udc) } /* Clear up all ep queues */ -static int reset_queues(struct fsl_udc *udc) +static int reset_queues(struct fsl_udc *udc, bool bus_reset) { u8 pipe; @@ -1783,7 +1783,10 @@ static int reset_queues(struct fsl_udc *udc) /* report disconnect; the driver is already quiesced */ spin_unlock(&udc->lock); - udc->driver->disconnect(&udc->gadget); + if (bus_reset) + usb_gadget_udc_reset(&udc->gadget, udc->driver); + else + udc->driver->disconnect(&udc->gadget); spin_lock(&udc->lock); return 0; @@ -1837,7 +1840,7 @@ static void reset_irq(struct fsl_udc *udc) udc->bus_reset = 1; /* Reset all the queues, include XD, dTD, EP queue * head and TR Queue */ - reset_queues(udc); + reset_queues(udc, true); udc->usb_state = USB_STATE_DEFAULT; } else { VDBG("Controller reset"); @@ -1846,7 +1849,7 @@ static void reset_irq(struct fsl_udc *udc) dr_controller_setup(udc); /* Reset all internal used Queues */ - reset_queues(udc); + reset_queues(udc, false); ep0_setup(udc); -- 1.7.9.5 -- 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