From 94ddeb4fa9fcbef0582f249a5f518572da304845 Mon Sep 17 00:00:00 2001 From: William Wu Date: Tue, 28 Nov 2017 10:57:35 +0800 Subject: [PATCH] usb: dwc_otg_310: reinit isoc ep frame num when dequeue The frame num of isoc ep is initialized to 0xFFFFFFFF in ep_enable and start_next_request(), and then in the NAK interrupt handler, it will check if the ep frame num is 0xFFFFFFFF, then reset the frame num to 0 and start next request. But if we dequeue the isoc ep request if it's already enqueued, if may fail to call complete_ep() -> start_ next_request(), so the isoc ep frame num can't be reinit to 0xFFFFFFFF, this cause NAK interrupt handler check the frame num incorrectly, and fail to start next request. Change-Id: Iab8526f6e3979347bdbe6c49525ec0ba8130d4bc Signed-off-by: William Wu --- drivers/usb/dwc_otg_310/dwc_otg_pcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c index 39fbbab27eb2..45f763e8031c 100644 --- a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c @@ -2496,6 +2496,9 @@ int dwc_otg_pcd_ep_dequeue(dwc_otg_pcd_t *pcd, void *ep_handle, } dwc_otg_request_done(ep, req, -DWC_E_RESTART); + + if (ep->dwc_ep.type == DWC_OTG_EP_TYPE_ISOC) + ep->dwc_ep.frame_num = 0xFFFFFFFF; } else { req = NULL; }