patch "usb: dwc3: Reset the transfer resource index on SET_INTERFACE" added to usb-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: dwc3: Reset the transfer resource index on SET_INTERFACE
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
aebda618718157a69c0dc0adb978d69bc2b8723cMon Sep 17 00:00:00 2001
From: John Youn <[email protected]>
Date: Mon, 17 Sep 2001 00:00:00 -0700
Subject: usb: dwc3: Reset the transfer resource index on SET_INTERFACE
This fixes an issue introduced in commit b23c843992b6 (usb: dwc3:
gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would only use DEPSTARTCFG once per SetConfig.
The trick is that we should use one DEPSTARTCFG per SetConfig *OR* SetInterface. SetInterface was completely missed from the original patch.
This problem became aparent after commit 76e838c9f776 (usb: dwc3:
gadget: return error if command sent to DEPCMD register fails) added checking of the return status of device endpoint commands.
'Set Endpoint Transfer Resource' command was caught failing occasionally. This is because the Transfer Resource Index was not getting reset during a SET_INTERFACE request.
Finally, to fix the issue, was we have to do is make sure that our start_config_issued flag gets reset whenever we receive a SetInterface request.
To verify the problem (and its fix), all we have to do is run test 9 from testusb with 'testusb -t 9 -s 2048 -a -c 5000'.
--- drivers/usb/dwc3/ep0.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/dwc3/ep0.c +4 -0
@@ -727,6 +727,10 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)dwc3_trace (trace_dwc3_ep0,"USB_REQ_SET_ISOCH_DELAY" ); ret =dwc3_ep0_set_isoch_delay (dwc, ctrl);break ; +case USB_REQ_SET_INTERFACE : +dwc3_trace (trace_dwc3_ep0,"USB_REQ_SET_INTERFACE" ); + dwc->start_config_issued = false; +/* Fall through */ default :dwc3_trace (trace_dwc3_ep0,"Forwarding to gadget driver" ); ret =dwc3_ep0_delegate_req (dwc, ctrl);
Signature · 1 line
2.4.6