Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6852361ybi; Wed, 5 Jun 2019 07:23:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8zaM/6jVmFA7hHfOiMB47bgxxZOTt7hbs29KK79GvHz8LdWMFx7RM/GUgbY7P5vmnhSZp X-Received: by 2002:a17:90a:a116:: with SMTP id s22mr44046834pjp.51.1559744627737; Wed, 05 Jun 2019 07:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559744627; cv=none; d=google.com; s=arc-20160816; b=ZMARcQpfByeEmexe8Dtv7KxUd4gURxutKzlGaCTaDMdnoj2NAM0QFbcpbMHpjG7IQi NdgFzQNI7JTwOUFDELEVLy1ybTdtmsE5J+7Amqa0BurWl+hWhopp8SnsRG3ZeUQrMFkp HQzZp/F039nn/wiMIlrVU8Fk9Zw/IUhc2DRi7RUz2MY8rgnerAchAU5aZvjj5UgL0+n3 txKi1gHXlgEXo51ks93gEeWl4YL1LIrJeZWbAVvz0goaddoF8SYduNCJ84Mwb9JAlHP0 pYUVoYnm8RKGr8fzJSfiz74065DICYAiq1v82A9Euy/egmePmk7xmffWB0NR4u/z2DQc y0cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=T/wAxQ12bjlMfwVXmfHK0GExd4OE1gYhjBgiTFltiW4=; b=T4wLN07pOB8js8Sf/eq1PNV5FKcLHbKYiCfF7vj2beRG3EiXpniYC2dS/TB732Nd4J TQAhgHb1qqD2V6gTOaxJpONyZGAiKuG5yHu2NJN2ous6/HjLFH49hBO6GeOLbfctgMow mwHVq88+OYf/1CqNLykg3NL9Nk8yHkl5gJygv/z0nJIkYc6sesN8AK3Td0jBueM0qO/a QZD0Qbwmr9yOVhgxfXv8O0o6OPXW8WWpsOx61WaKaIJ0Dal7fc/DXWcWocVorJQOKAKo FUxulsOul835LPqmVzazeMGJ2g1mns5wmMeAsMfx8zqE65wldqkD7092zUw5vIZ6NHMA XDew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si3405617pfi.75.2019.06.05.07.23.30; Wed, 05 Jun 2019 07:23:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728307AbfFEOWD (ORCPT + 99 others); Wed, 5 Jun 2019 10:22:03 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:56492 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728224AbfFEOWD (ORCPT ); Wed, 5 Jun 2019 10:22:03 -0400 Received: (qmail 2013 invoked by uid 2102); 5 Jun 2019 10:22:02 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 5 Jun 2019 10:22:02 -0400 Date: Wed, 5 Jun 2019 10:22:02 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Yinbo Zhu cc: xiaobo.xie@nxp.com, Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Ran Wang , , , Subject: Re: [PATCH v6 4/5] usb: host: Stops USB controller init if PLL fails to lock In-Reply-To: <20190605054952.34687-4-yinbo.zhu@nxp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Jun 2019, Yinbo Zhu wrote: > From: Ramneek Mehresh > > USB erratum-A006918 workaround tries to start internal PHY inside > uboot (when PLL fails to lock). However, if the workaround also > fails, then USB initialization is also stopped inside Linux. > Erratum-A006918 workaround failure creates "fsl,erratum_a006918" > node in device-tree. Presence of this node in device-tree is > used to stop USB controller initialization in Linux > > Signed-off-by: Ramneek Mehresh > Signed-off-by: Suresh Gupta > Signed-off-by: Yinbo Zhu > --- > Change in v6: > add a "Fall through" comment > > drivers/usb/host/ehci-fsl.c | 10 +++++++++- > drivers/usb/host/fsl-mph-dr-of.c | 3 ++- > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c > index 8f3bf3efb038..86ae37086a74 100644 > --- a/drivers/usb/host/ehci-fsl.c > +++ b/drivers/usb/host/ehci-fsl.c > @@ -234,8 +234,16 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, > break; > case FSL_USB2_PHY_UTMI_WIDE: > portsc |= PORT_PTS_PTW; > - /* fall through */ > case FSL_USB2_PHY_UTMI: > + /* Presence of this node "has_fsl_erratum_a006918" > + * in device-tree is used to stop USB controller > + * initialization in Linux > + */ > + if (pdata->has_fsl_erratum_a006918) { > + dev_warn(dev, "USB PHY clock invalid\n"); > + return -EINVAL; > + } > + > case FSL_USB2_PHY_UTMI_DUAL: This is bad. You got rid of a "fall through" comment that was needed, and you failed to add another one where it was needed. Alan Stern > /* PHY_CLK_VALID bit is de-featured from all controller > * versions below 2.4 and is to be checked only for > diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c > index 4f8b8a08c914..762b97600ab0 100644 > --- a/drivers/usb/host/fsl-mph-dr-of.c > +++ b/drivers/usb/host/fsl-mph-dr-of.c > @@ -224,13 +224,14 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev) > of_property_read_bool(np, "fsl,usb-erratum-a005275"); > pdata->has_fsl_erratum_a005697 = > of_property_read_bool(np, "fsl,usb_erratum-a005697"); > + pdata->has_fsl_erratum_a006918 = > + of_property_read_bool(np, "fsl,usb_erratum-a006918"); > > if (of_get_property(np, "fsl,usb_erratum_14", NULL)) > pdata->has_fsl_erratum_14 = 1; > else > pdata->has_fsl_erratum_14 = 0; > > - > /* > * Determine whether phy_clk_valid needs to be checked > * by reading property in device tree >