From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82ED3C4332F for ; Thu, 13 Oct 2022 14:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=FVoYqbCz9S+VN4h1t/avxxoIzuh6PXENolJWcv9xzio=; b=IWV+X7THMxOcBr ASMIE+jg8KSGEPEbRVyquOUAY+ythN/teWaciTqfJaEXZ6o0c9kU2dwfXRqcPTTWFGnZ2e7NPWE0y Z9RpXsYydh09ldpvCyMZUQ9cP813eNED910toFfvVx38WXJA3vFuOTvT2uu5Gpzyo4jnA7dZJIV73 4Hy+zKqHnqDDZAmETjCAW33Vfi4H96rFFAZstTEKmEqGl+frNkKFFwh6F4GRbA5zAix3tvcAWcIoO DInd9gHF6IkWksd3z/+202/CEQK7wpBEWBJ4MGaAsUWZ4lAB0DtNFY7RhlMdURuTUfkrdcdvtN52y czlIhwKhT94CmG4ifIEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiypX-00C5Yo-Mq; Thu, 13 Oct 2022 14:04:59 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiypT-00C5X4-1m for linux-arm-kernel@lists.infradead.org; Thu, 13 Oct 2022 14:04:57 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 76993B81D03; Thu, 13 Oct 2022 14:04:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 011C1C433D6; Thu, 13 Oct 2022 14:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665669892; bh=9PYpYkdxdeYP9ZMQ9IALmGecY9rvjMIMkVX1EfnhvD4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SXNLO0pQxNTtMW1KrUNwd8f5ABQ+KbrRqqFLsFy0Be9NvgwmsuxvpL3ply5bztQP9 3Sm7JuLOIhHvsvZ0VFSB1Nza3Z6qcJeVQJN0K0N3X93R9+VhngIUSEFI9JuhRFpTSw uLeHXBEr66ZKIeLgLfopFO1DXNepLBPl1OI8ra9Z+7msXlEteE+38+9E5yGad7KfX9 4yxfIOSTiHhWAewsOb32xRuZ3Xqh9npe4nvgh2XFTzt68Ezmg1tUmzgjfhGGyN8ity gWwKKRox2S6CTAIhHexUcHBLsrHBY1L0aUa02UH6JWVmNEBHWEg6TAisRnWhEXToxj dAhRNtdCk9hEA== Date: Thu, 13 Oct 2022 09:04:50 -0500 From: Bjorn Helgaas To: Sascha Hauer Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Richard Zhu , Lorenzo Pieralisi , Pengutronix Kernel Team , NXP Linux Team , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Subject: Re: [PATCH] PCI: imx6: Fix link initialisation when the phy is ref clk provider Message-ID: <20221013140450.GA3244741@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221012132634.267970-1-s.hauer@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221013_070455_261606_812D51E8 X-CRM114-Status: GOOD ( 24.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Would you mind rewording the subject so it says something more specific about what the patch does? E.g., PCI: imx6: Initialize PHY before deasserting core reset It may be that this ordering is only *required* when the PHY is the ref clk provider, but the patch doesn't test for that; it *always* initializes the PHY first. On Wed, Oct 12, 2022 at 03:26:34PM +0200, Sascha Hauer wrote: > When the phy is the reference clock provider then it must be initialised > and powered on before the reset on the client is deasserted, otherwise > the link will never come up. The order was changed in cf236e0c0d59. > Restore the correct order to make the driver work again on boards where > the phy provides the reference clock. s/phy/PHY/ several places above > Fixes: cf236e0c0d59 ("PCI: imx6: Do not hide PHY driver callbacks and refine the error handling") > Signed-off-by: Sascha Hauer > --- > drivers/pci/controller/dwc/pci-imx6.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c > index b5f0de455a7bd..211eb55d6d34b 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -942,12 +942,6 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) > } > } > > - ret = imx6_pcie_deassert_core_reset(imx6_pcie); > - if (ret < 0) { > - dev_err(dev, "pcie deassert core reset failed: %d\n", ret); > - goto err_phy_off; > - } > - > if (imx6_pcie->phy) { > ret = phy_power_on(imx6_pcie->phy); > if (ret) { > @@ -955,6 +949,13 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) > goto err_phy_off; > } > } > + > + ret = imx6_pcie_deassert_core_reset(imx6_pcie); > + if (ret < 0) { > + dev_err(dev, "pcie deassert core reset failed: %d\n", ret); > + goto err_phy_off; > + } > + > imx6_setup_phy_mpll(imx6_pcie); > > return 0; > -- > 2.30.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel