From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757584AbcIWA6L (ORCPT ); Thu, 22 Sep 2016 20:58:11 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:57707 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756365AbcIWA6I (ORCPT ); Thu, 22 Sep 2016 20:58:08 -0400 Subject: Re: [PATCH] usb: dwc2: add USBTrdTim to initial value To: Pengcheng Li , "John.Youn@synopsys.com" References: <1474508357-119468-1-git-send-email-lpc.li@hisilicon.com> From: John Youn CC: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "xuejiancheng@hisilicon.com" , "lidongpo@hisilicon.com" , "caizhiyong@hisilicon.com" , Felipe Balbi Message-ID: Date: Thu, 22 Sep 2016 17:58:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1474508357-119468-1-git-send-email-lpc.li@hisilicon.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.10.186.99] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/21/2016 6:43 PM, Pengcheng Li wrote: > After dwc2_core_reset,register is to the initial value, and the USBTrdTim > vale is 0x5. If hsotg->phyif = GUSBCFG_PHYIF8, after the dwc2_writel,the > value is 0xd.So we need to set the USBTrdTim to 0. [++ Felipe] Looks good. But please clean up the subject and message Subject: usb: dwc2: Clear GUSBCFG.UsbTrdTim before setting Description: The USBTRDTIM field needs to be cleared before setting a new value. Otherwise it will result in an incorrect value if phyif == GUSBCFG_PHYIF8. With that Acked-by: John Youn Thanks, John > > Signed-off-by: Pengcheng Li > --- > drivers/usb/dwc2/gadget.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c > index af46adf..9e52e4f 100644 > --- a/drivers/usb/dwc2/gadget.c > +++ b/drivers/usb/dwc2/gadget.c > @@ -2531,7 +2531,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, > /* keep other bits untouched (so e.g. forced modes are not lost) */ > usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); > usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | > - GUSBCFG_HNPCAP); > + GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK); > > /* set the PLL on, remove the HNP/SRP and set the PHY */ > val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; > @@ -3413,7 +3413,7 @@ static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg) > /* keep other bits untouched (so e.g. forced modes are not lost) */ > usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); > usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | > - GUSBCFG_HNPCAP); > + GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK); > > /* set the PLL on, remove the HNP/SRP and set the PHY */ > trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; >