Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932274AbbHNAJK (ORCPT ); Thu, 13 Aug 2015 20:09:10 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:53938 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088AbbHNAJJ convert rfc822-to-8bit (ORCPT ); Thu, 13 Aug 2015 20:09:09 -0400 From: John Youn To: Yunzhi Li , "jwerner@chromium.org" , "dianders@chromium.org" CC: "huangtao@rock-chips.com" , "cf@rock-chips.com" , "hl@rock-chips.com" , "wulf@rock-chips.com" , "gregory.herrero@intel.com" , "linux-rockchip@lists.infradead.org" , John Youn , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1 1/3] usb: dwc2: reset AHB hclk domain before init Thread-Topic: [PATCH v1 1/3] usb: dwc2: reset AHB hclk domain before init Thread-Index: AQHQ1AtYMMVWzUHw2kK+pG1YmrjVMg== Date: Fri, 14 Aug 2015 00:09:05 +0000 Message-ID: <2B3535C5ECE8B5419E3ECBE300772909017528DC44@US01WEMBX2.internal.synopsys.com> References: <1439279787-26674-1-git-send-email-lyz@rock-chips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.9.139.186] 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 Content-Length: 2528 Lines: 77 On 8/11/2015 12:57 AM, Yunzhi Li wrote: > We initiate dwc2 usb controller in BIOS, when kernel driver > start-up we should reset AHB hclk domain to reset all AHB > interface registers to default. Without this the FIFO value > setting might be incorrect because calculating FIFO size need the > power-on value of GRXFSIZ/GNPTXFSIZ/HPTXFSIZ registers. > > This patch could avoid warnning massage like in rk3288 platform: > [ 2.074764] dwc2 ff580000.usb: 256 invalid for > host_perio_tx_fifo_size. Check HW configuration. > > Signed-off-by: Yunzhi Li > --- > > drivers/usb/dwc2/platform.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c > index 9093530..ec6bf6b 100644 > --- a/drivers/usb/dwc2/platform.c > +++ b/drivers/usb/dwc2/platform.c > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include > > #include > > @@ -165,6 +166,7 @@ static int dwc2_driver_probe(struct platform_device *dev) > struct resource *res; > struct phy *phy; > struct usb_phy *uphy; > + struct reset_control *rst; > int retval; > int irq; > > @@ -189,6 +191,16 @@ static int dwc2_driver_probe(struct platform_device *dev) > > hsotg->dev = &dev->dev; > > + /* AHB hclk domain reset, set all AHB interface registers to default */ > + rst = devm_reset_control_get_optional(&dev->dev, "ahb"); > + if (IS_ERR(rst)) { > + dev_dbg(&dev->dev, "Can't get dwc2 AHB reset\n"); > + } else { > + reset_control_assert(rst); > + udelay(5); > + reset_control_deassert(rst); > + } > + > /* > * Use reasonable defaults so platforms don't have to provide these. > */ > I didn't receive the other two patches in this series so I was confused about where the "ahb_reset" was coming from when I replied to your other patch. I see you changed the name and documented the DT so never mind. Another thing is that there probably shouldn't be a debug message on the IS_ERR condition since that is the common case and of no interest to other platforms. The other two resets you added aren't used by the driver anywhere right? Maybe those should be left out until they are. John -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/