From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbcBPBfb (ORCPT ); Mon, 15 Feb 2016 20:35:31 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:59107 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbcBPBfa convert rfc822-to-8bit (ORCPT ); Mon, 15 Feb 2016 20:35:30 -0500 From: John Youn To: Jianqiang Tang , John Youn CC: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Dyson Lee Subject: Re: [PATCH] usb: dwc2: host: fix the data toggle error in full speed descriptor dma Thread-Topic: [PATCH] usb: dwc2: host: fix the data toggle error in full speed descriptor dma Thread-Index: AQHRWAGtZ9wlNJ24HU+ZQW/Lixfncw== Date: Tue, 16 Feb 2016 01:35:28 +0000 Message-ID: <2B3535C5ECE8B5419E3ECBE30077290901DC448F48@US01WEMBX2.internal.synopsys.com> References: <1453789020-9271-1-git-send-email-jianqiang.tang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.12.67.47] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/2016 10:20 PM, Jianqiang Tang wrote: > From: "Tang, Jianqiang" > > There will be data toggle error happen for full speed buld-out transfer. > The data toggle bit is saved in qh for non-control transfers, it is wrong > to check the qtd for that case. > > Also fix one static analysis tool issue after fix the data toggle error. > > Signed-off-by: Dyson Lee > Signed-off-by: Tang, Jianqiang > --- > drivers/usb/dwc2/hcd_ddma.c | 2 +- > drivers/usb/dwc2/hcd_intr.c | 4 ++++ > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c > index 36606fc..6b18956 100644 > --- a/drivers/usb/dwc2/hcd_ddma.c > +++ b/drivers/usb/dwc2/hcd_ddma.c > @@ -1258,7 +1258,7 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, > */ > if (halt_status == DWC2_HC_XFER_STALL) > qh->data_toggle = DWC2_HC_PID_DATA0; > - else if (qtd) > + else > dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); > } > > diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c > index f825380..918773f 100644 > --- a/drivers/usb/dwc2/hcd_intr.c > +++ b/drivers/usb/dwc2/hcd_intr.c > @@ -530,6 +530,10 @@ void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, > else > chan->qh->data_toggle = DWC2_HC_PID_DATA1; > } else { > + if (!qtd) { > + dev_err(hsotg->dev, "qtd is null, return\n"); > + return; > + } > if (pid == TSIZ_SC_MC_PID_DATA0) > qtd->data_toggle = DWC2_HC_PID_DATA0; > else > Thanks for this. I've applied this internally for testing and added WARNs in the dwc2_hcd_save_data_toggle function(). I will resend for review along with another fix that we have for DDMA in that same area. Regards, John