mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
usb: gadget: Restart USB session if start xfer fails for ep0
Currently driver is just proceding further if start xfer times out for ep0. Start xfer failing for ep0 indicates that the controller is already in bad state and it can access unmapped address leading to SMMU fault. Prevent this by marking this as an error event and restart USB session. Change-Id: Ia46387e16a79318ad945079ced7209a8f2bf47ef Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
This commit is contained in:
parent
0d384b92bf
commit
f2f05457ef
1 changed files with 13 additions and 1 deletions
|
|
@ -78,8 +78,20 @@ static int dwc3_ep0_start_trans(struct dwc3_ep *dep)
|
|||
params.param1 = lower_32_bits(dwc->ep0_trb_addr);
|
||||
|
||||
ret = dwc3_send_gadget_ep_cmd(dep, DWC3_DEPCMD_STARTTRANSFER, ¶ms);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
if (ret == -ETIMEDOUT) {
|
||||
/*
|
||||
* If start transfer is timing out then mark it as an error
|
||||
* event since the controller is already in an unknown
|
||||
* state.
|
||||
*/
|
||||
dbg_log_string("%s: error event seen\n", __func__);
|
||||
dwc->err_evt_seen = true;
|
||||
dwc3_notify_event(dwc, DWC3_CONTROLLER_ERROR_EVENT, 0);
|
||||
dwc3_notify_event(dwc, DWC3_CONTROLLER_NOTIFY_CLEAR_DB, 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
dwc->ep0_next_event = DWC3_EP0_COMPLETE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue