]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: Reset the transfer resource index on SET_INTERFACE
authorJohn Youn <John.Youn@synopsys.com>
Mon, 17 Sep 2001 07:00:00 +0000 (00:00 -0700)
committerFelipe Balbi <balbi@ti.com>
Wed, 22 Jul 2015 13:52:42 +0000 (08:52 -0500)
commitc3254eb53f4054e181564a892effa2b2d310f72c
treefec951eae8a5e725e36451b11e23ad66dc327916
parentf5b2de76bd8dc1d44f5f62d7d3881b16dede18eb
usb: dwc3: Reset the transfer resource index on SET_INTERFACE

This fixes an issue introduced in commit 55c3ee80cef0 (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 773bf485f4c6 (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'.

Tested-by: Huang Rui <ray.huang@amd.com>
Tested-by: Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>
Fixes: 55c3ee80cef0 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs)
Cc: <stable@vger.kernel.org> # v3.2+
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/ep0.c