From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ARC-Seal: i=1; a=rsa-sha256; t=1516225566; cv=none; d=google.com; s=arc-20160816; b=QUbXMvmKqrCQrEZcRMgZvxqr72C4yvUNYLNjFmP3ISz9p4pRHtjQyoqkSBmmtxp5Yx 1m7Wn9RAOs57b7Xx5I051iEHmz67sXzH5SZueUD5V1Y4XbUWRBuPHxXdPMYmOHrChjVl H8nfPQ7//PLEZNLf7lKq8QpcgqTmQR0jpj9biOjYndq5oFwfoosjBRhcz+OIL3r3WHIY GCMpsXJsA/RZCbfX2tNfwTmxU+wIgFjDSn7vPaYOc1CiJdtrZKn9oxWZLyJ/VGBi18sR n071cNZvlDvRDqs2ECc63yrcdzuGqOykSm3Q+fqyCo7j2LSE28meSWf+EwvBGOsICDBb WJng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=2t+UTjN1Z7VMf/e1rKxYgteyDGeSHeN+alzTkVmMQwg=; b=IOrU2EtYhSZ7WPAImshABouIHHRXfndWg7RZGIA2ATgf2AyxxliUIQIoRZ8bVAKJ9X 7ftGXlnzWAi+vyM7xRAAd3Tm3Vjp2Ohxbslshxg0J/7hBD8Y9wnsMsH5Wc5yC5opxH1W ImAiUqzwcRJ3BFDJt7w9n9Dt6TSsmEowHuyxZUHU7NlktxS4S74clMRFwk7liA1ZDjcU +eiCz2+54/YBvaCc0iZQDKjdNAxpHtk5vKRxhP3RJ3ZVffuExE8BKe1/xVcatRnTEdFf OEux+DjvEl7Jw8Iuv2g0CCDsvFXkMaSULSFbURzyqVjPdt0DHPkmrd/q0r7WK0E/BFad zksA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PV26PgGb; spf=pass (google.com: domain of briannorris@chromium.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=briannorris@chromium.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PV26PgGb; spf=pass (google.com: domain of briannorris@chromium.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=briannorris@chromium.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Google-Smtp-Source: ACJfBov8NWETC+8DVKPkCwAGo/dU8W+/JJZM2VGJkA9MYAy6JTDRFKxYxZZlFo8FN/cmiDx7SRYSCA== Date: Wed, 17 Jan 2018 13:46:03 -0800 From: Brian Norris To: William Wu Cc: balbi@kernel.org, gregkh@linuxfoundation.org, heiko@sntech.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, frank.wang@rock-chips.com, huangtao@rock-chips.com, dianders@google.com, groeck@google.com, daniel.meng@rock-chips.com, John.Youn@synopsys.com, lin.huang@rock-chips.com Subject: Re: [PATCH] usb: dwc3: core: power on PHYs before initializing core Message-ID: <20180117214601.GA111796@google.com> References: <1515729616-8639-1-git-send-email-william.wu@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515729616-8639-1-git-send-email-william.wu@rock-chips.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589357732274674960?= X-GMAIL-MSGID: =?utf-8?q?1589877738821226593?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Fri, Jan 12, 2018 at 12:00:16PM +0800, William Wu wrote: > The dwc3_core_init() gets the PHYs and initializes the PHYs with > the usb_phy_init() and phy_init() functions before initializing > core, and power on the PHYs after core initialization is done. > > However, some platforms (e.g. Rockchip RK3399 DWC3 with Type-C > USB3 PHY), it needs to do some special operation while power on > the Type-C PHY before initializing DWC3 core. It's because that > the RK3399 Type-C PHY requires to hold the DWC3 controller in > reset state to keep the PIPE power state in P2 while configuring > the Type-C PHY, otherwise, it may cause waiting for the PIPE ready > timeout. In this case, if we power on the PHYs after the DWC3 core > initialization is done, the core will be reset to uninitialized > state after power on the PHYs. > > Fix this by powering on the PHYs before initializing core. And > because the GUID register may also be reset in this case, so we > need to configure the GUID register after powering on the PHYs. > > Signed-off-by: William Wu This kinda should be part of your series: [PATCH 0/3] Reset USB3 controller before initializing Type-C PHY on rk3399 or at least mentioned there, because the series there doesn't quite right otherwise, no? Anyway, I think this patch looks OK. I don't immediately see good reasons for delaying the PHY init until later, and I do see reasons why it could be useful earlier: Reviewed-by: Brian Norris > --- > drivers/usb/dwc3/core.c | 46 ++++++++++++++++++++++------------------------ > 1 file changed, 22 insertions(+), 24 deletions(-)