Loading drivers/usb/dwc3/core.h +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #define DWC3_EP0_SETUP_SIZE 512 #define DWC3_ENDPOINTS_NUM 32 #define DWC3_XHCI_RESOURCES_NUM 2 #define MAX_ERROR_RECOVERY_TRIES 3 #define DWC3_SCRATCHBUF_SIZE 4096 /* each buffer is assumed to be 4KiB */ #define DWC3_EVENT_BUFFERS_SIZE 4096 Loading Loading @@ -1204,6 +1205,7 @@ struct dwc3 { * connected devices on PM resume. */ bool host_poweroff_in_pm_suspend; int retries_on_error; }; #define work_to_dwc(w) (container_of((w), struct dwc3, drd_work)) Loading drivers/usb/dwc3/dwc3-msm.c +7 −2 Original line number Diff line number Diff line Loading @@ -1931,7 +1931,12 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event, reg |= DWC3_GCTL_CORESOFTRESET; dwc3_msm_write_reg(mdwc->base, DWC3_GCTL, reg); /* restart USB which performs full reset and reconnect */ /* * If core could not recover after MAX_ERROR_RECOVERY_TRIES * skip the restart USB work and keep the core in softreset * state */ if (dwc->retries_on_error < MAX_ERROR_RECOVERY_TRIES) schedule_work(&mdwc->restart_usb_work); break; case DWC3_CONTROLLER_RESET_EVENT: Loading drivers/usb/dwc3/gadget.c +6 −1 Original line number Diff line number Diff line Loading @@ -2106,6 +2106,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) reg1 |= DWC3_GEVNTSIZ_INTMASK; dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), reg1); dwc->err_evt_seen = false; dwc->pullups_connected = false; __dwc3_gadget_ep_disable(dwc->eps[0]); Loading Loading @@ -3280,6 +3281,9 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_DEVTEN, reg); } /* Reset the retry on erratic error event count */ dwc->retries_on_error = 0; /* * RAMClkSel is reset to 0 after USB reset, so it must be reprogrammed * each time on Connect Done. Loading Loading @@ -3643,7 +3647,7 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc, dwc->dbg_gadget_events.sof++; break; case DWC3_DEVICE_EVENT_ERRATIC_ERROR: dbg_event(0xFF, "ERROR", 0); dbg_event(0xFF, "ERROR", dwc->retries_on_error); dwc->dbg_gadget_events.erratic_error++; dwc->err_evt_seen = true; break; Loading Loading @@ -3701,6 +3705,7 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt) if (dwc3_notify_event(dwc, DWC3_CONTROLLER_ERROR_EVENT, 0)) dwc->err_evt_seen = 0; dwc->retries_on_error++; break; } Loading Loading
drivers/usb/dwc3/core.h +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #define DWC3_EP0_SETUP_SIZE 512 #define DWC3_ENDPOINTS_NUM 32 #define DWC3_XHCI_RESOURCES_NUM 2 #define MAX_ERROR_RECOVERY_TRIES 3 #define DWC3_SCRATCHBUF_SIZE 4096 /* each buffer is assumed to be 4KiB */ #define DWC3_EVENT_BUFFERS_SIZE 4096 Loading Loading @@ -1204,6 +1205,7 @@ struct dwc3 { * connected devices on PM resume. */ bool host_poweroff_in_pm_suspend; int retries_on_error; }; #define work_to_dwc(w) (container_of((w), struct dwc3, drd_work)) Loading
drivers/usb/dwc3/dwc3-msm.c +7 −2 Original line number Diff line number Diff line Loading @@ -1931,7 +1931,12 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event, reg |= DWC3_GCTL_CORESOFTRESET; dwc3_msm_write_reg(mdwc->base, DWC3_GCTL, reg); /* restart USB which performs full reset and reconnect */ /* * If core could not recover after MAX_ERROR_RECOVERY_TRIES * skip the restart USB work and keep the core in softreset * state */ if (dwc->retries_on_error < MAX_ERROR_RECOVERY_TRIES) schedule_work(&mdwc->restart_usb_work); break; case DWC3_CONTROLLER_RESET_EVENT: Loading
drivers/usb/dwc3/gadget.c +6 −1 Original line number Diff line number Diff line Loading @@ -2106,6 +2106,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) reg1 |= DWC3_GEVNTSIZ_INTMASK; dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), reg1); dwc->err_evt_seen = false; dwc->pullups_connected = false; __dwc3_gadget_ep_disable(dwc->eps[0]); Loading Loading @@ -3280,6 +3281,9 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_DEVTEN, reg); } /* Reset the retry on erratic error event count */ dwc->retries_on_error = 0; /* * RAMClkSel is reset to 0 after USB reset, so it must be reprogrammed * each time on Connect Done. Loading Loading @@ -3643,7 +3647,7 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc, dwc->dbg_gadget_events.sof++; break; case DWC3_DEVICE_EVENT_ERRATIC_ERROR: dbg_event(0xFF, "ERROR", 0); dbg_event(0xFF, "ERROR", dwc->retries_on_error); dwc->dbg_gadget_events.erratic_error++; dwc->err_evt_seen = true; break; Loading Loading @@ -3701,6 +3705,7 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt) if (dwc3_notify_event(dwc, DWC3_CONTROLLER_ERROR_EVENT, 0)) dwc->err_evt_seen = 0; dwc->retries_on_error++; break; } Loading