From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn1bon0117.outbound.protection.outlook.com ([157.56.111.117]:22304 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933788AbbGVLjh (ORCPT ); Wed, 22 Jul 2015 07:39:37 -0400 Date: Wed, 22 Jul 2015 18:03:06 +0800 From: Huang Rui To: Felipe Balbi CC: Linux USB Mailing List , David Cohen , Subbaraya Sundeep Bhatta , Andy Gross , Kukjin Kim , Heikki Krogerus , John Youn , , John Youn Subject: Re: [PATCH] usb: dwc3: Reset the transfer resource index on SET_INTERFACE Message-ID: <20150722100306.GD8121@hr-slim.amd.com> References: <1437488958-2272-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1437488958-2272-1-git-send-email-balbi@ti.com> Sender: stable-owner@vger.kernel.org List-ID: On Tue, Jul 21, 2015 at 09:29:17AM -0500, Felipe Balbi wrote: > From: John Youn > > 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'. > > Fixes: b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs) > Cc: # v3.2+ > Signed-off-by: John Youn > Signed-off-by: Felipe Balbi Felipe, I've verified it in my side. :) ray@hr-slim:~/linux-usb$ sudo ./tools/usb/testusb -D /dev/bus/usb/002/004 -t 9 -s 2048 -a -c 5000 unknown speed /dev/bus/usb/002/004 0 /dev/bus/usb/002/004 test 9, 15.300784 secs Tested-by: Huang Rui