Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbdLYC7j convert rfc822-to-8bit (ORCPT ); Sun, 24 Dec 2017 21:59:39 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:2494 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751459AbdLYC7f (ORCPT ); Sun, 24 Dec 2017 21:59:35 -0500 From: Lipengcheng To: Felipe Balbi CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO Thread-Topic: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO Thread-Index: AQHTeiQKaTF0bts+TkiJSeXlM4bbfaNOeasAgATnBJA= Date: Mon, 25 Dec 2017 02:58:42 +0000 Message-ID: <637796ED17F7774FB27D6AAE3C6951584B38CDE2@dggeml508-mbx.china.huawei.com> References: <637796ED17F7774FB27D6AAE3C6951584B38C043@dggeml508-mbx.china.huawei.com> <87zi6bp59h.fsf@linux.intel.com> In-Reply-To: <87zi6bp59h.fsf@linux.intel.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.222.17] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1866 Lines: 51 Hi, > -----Original Message----- > From: Felipe Balbi [mailto:balbi@kernel.org] > Sent: Friday, December 22, 2017 3:54 PM > To: Lipengcheng > Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org; Lipengcheng > Subject: Re: [PATCH] usb: dwc3: gadget:Core consumes a trb software to fill a trb, in ISO > > > Hi, > > Lipengcheng writes: > > > Iso transmission, the current process is that all trb(HWO=1) is handled. > > Then core generate DWC3_DEPEVT_XFERNOTREADY event, Software begin > > refill trb, this will produce 0 length package, the patch is to > > achieve the core consumes a trb, and then the software fill a trb. > > Normally, there will never be DWC3_DEPEVT_XFERNOTREADY event and 0-length packet. > > > > Signed-off-by: l00229106 > > who is 100229106?? Sorry. It is my job number. I will use Pengcheng li to replace it. > > > --- > > drivers/usb/dwc3/gadget.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 981fd98..1e6c42e 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -2420,7 +2420,7 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc, > > if (!dep->endpoint.desc) > > return; > > > > - if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) > > + if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) || (dep->flags & > > + DWC3_EP_TRANSFER_STARTED)) > > this is wrong. isoc endpoints should NEVER be prestarted. The main purpose is to core handle a trb and sofware re-fill the next trb in the DWC3_DEPEVT_XFERINPROGRESS interrupt. Mayebe it can be modified: if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) __dwc3_gadget_kick_transfer(dep); + else + dwc3_prepare_trbs(dep); + > > -- > balbi