Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp78774rwb; Fri, 2 Sep 2022 10:27:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR60cRW9W77GsL+D5fRuolp0Lr3qP/s+aTPSegR96HvOBDXWNScR6yoACEZh3+IfPNz47pVA X-Received: by 2002:a05:6a00:3406:b0:535:f76f:c971 with SMTP id cn6-20020a056a00340600b00535f76fc971mr37606371pfb.5.1662139653259; Fri, 02 Sep 2022 10:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662139653; cv=none; d=google.com; s=arc-20160816; b=AWLOSmGLS4XWKI7HAWRs+X+EowqSFgBE17kuoaZz8sv5oevdJlys/pVJsY5ekotOIn SFhPlvwrYGR057HQhIJqdJPcFI2uI5Caf/FJ9UavQHR6VDxXxlJfiwRdJhVrVlSqHH3Z K16bCWso63ZIT0jX5IVMnSI6AICUlHFr2FBrN6N5hfDRTUA2Fos2e+T0gH2+kZDVijPq GskDxjzDM2iLFZlQRu/r563qVF8l3Rm22TGjzjh8K/giRUQii6L2d5FMBGNEJiZyw7Ij kIMbA1l96+Sx3OI4tq7eXPpE6hIHYMZmQKE7OIbAOVeYi6FnvHbsuYhRyqULt44wbMNk 1/dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=BMHq5QbrUiiihydbYy1uJuVsMc5EO6mj2Wq2gZAy8rk=; b=cSEup/qIUbgFGPgmGSr+D1g2NNGXhdHQ0er//Af/IV0sMmQSBbP8q1AYE5fzodUNks PRxIbDkVMy/EEJcYyQuL2J6PpvmPpWu2yIZ2mPXTSGAI3qCGZMCzdDGHV5eCaWTyaCy7 qra+rUkj5q0EFwnRZy0yDEXZ1dpRr2UUawBXXYlX/dGx9DBi2keVgFF7TN74Hd4juY9i i02pumCNm8p1QY/tG/0T5lbAF9wk4AnYQVt+ZU6PjWL6ay7RtX8cdZvkoDf0yE9lvaQU d0O1rUznSks9CZcUgot6Z1WgrQLzvfNjid+H6pRvvqfHeY5SdHliYTX2vwEzzteXgMFH E31g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PRpPlEAS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a636a08000000b0043158b8cb9fsi1551445pgc.196.2022.09.02.10.27.22; Fri, 02 Sep 2022 10:27:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PRpPlEAS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236213AbiIBRFB (ORCPT + 99 others); Fri, 2 Sep 2022 13:05:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236291AbiIBRE5 (ORCPT ); Fri, 2 Sep 2022 13:04:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFD2115A11; Fri, 2 Sep 2022 10:04:53 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 4D571621AE; Fri, 2 Sep 2022 17:04:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AE77C433C1; Fri, 2 Sep 2022 17:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662138291; bh=lAxIv2QfUf2l3nKsqdu22JAcrnIgJ48N3jh5vnIFQzc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=PRpPlEAS+vV10WkjFd2TH3iPGH/W+xDWHqXVC9AXUx6z6Y1sDQ3leqzZAC3t60T7l uqeZ/8qorvgJhSS1r8iQqv1WAersSU+3+BYJLz3uP0Ni+YHlTM6qI3dcoxiZLbIOSM iftOWO8qkp2Sg2Hrs6v3wS6MqdwqRlEJAUQ/NBQZQsXGIAKEstjDuhOAvM+PJjQuB+ 9cL8+MU9v8qi1FSVt3biWE7zzO2Yxv+qLsBb85UAD9wFcAvzvAn92+Fxjs44/unia9 L1yjEHFmn1+j/5k6ovZp0Wd2hjaV+FowWP154owJUEYyK6M6Yj3T/G3MoVIH/CmW+l Y9MvqPRcxOZ7A== Date: Fri, 2 Sep 2022 12:04:49 -0500 From: Bjorn Helgaas To: Richard Zhu Cc: a.fatoum@pengutronix.de, l.stach@pengutronix.de, bhelgaas@google.com, lorenzo.pieralisi@arm.com, vkoul@kernel.org, marcel.ziswiler@toradex.com, kishon@ti.com, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: Re: [PATCH v2] phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on() Message-ID: <20220902170449.GA354728@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1661928956-12727-1-git-send-email-hongxing.zhu@nxp.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 31, 2022 at 02:55:56PM +0800, Richard Zhu wrote: > Refer to phy_core driver, phy_init() must be called before phy_power_on(). > Fix the wrong order of phy_init() and phy_power_on() here. > Squash the changes into one patch to avoid the possible bi-section hole. Avoiding bisection holes goes without saying, so I don't think we need to even mention it ;) > Fixes: 1aa97b002258 ("phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver") > Signed-off-by: Richard Zhu > Tested-by: Alexander Stein I propose merging this via PCI, since I suspect pci-imx6.c is more active than phy-fsl-imx8m-pcie.c. Vinod, if you agree, I'm sure Lorenzo will look for your ack. > --- > drivers/pci/controller/dwc/pci-imx6.c | 6 +++--- > drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 8 ++++---- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c > index 6e5debdbc55b..b5f0de455a7b 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -935,7 +935,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) > } > > if (imx6_pcie->phy) { > - ret = phy_power_on(imx6_pcie->phy); > + ret = phy_init(imx6_pcie->phy); > if (ret) { > dev_err(dev, "pcie PHY power up failed\n"); > goto err_clk_disable; > @@ -949,7 +949,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) > } > > if (imx6_pcie->phy) { > - ret = phy_init(imx6_pcie->phy); > + ret = phy_power_on(imx6_pcie->phy); > if (ret) { > dev_err(dev, "waiting for PHY ready timeout!\n"); > goto err_phy_off; > @@ -961,7 +961,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) > > err_phy_off: > if (imx6_pcie->phy) > - phy_power_off(imx6_pcie->phy); > + phy_exit(imx6_pcie->phy); > err_clk_disable: > imx6_pcie_clk_disable(imx6_pcie); > err_reg_disable: > diff --git a/drivers/phy/freescale/phy-fsl-imx8m-pcie.c b/drivers/phy/freescale/phy-fsl-imx8m-pcie.c > index ad7d2edfc414..c93286483b42 100644 > --- a/drivers/phy/freescale/phy-fsl-imx8m-pcie.c > +++ b/drivers/phy/freescale/phy-fsl-imx8m-pcie.c > @@ -59,7 +59,7 @@ struct imx8_pcie_phy { > bool clkreq_unused; > }; > > -static int imx8_pcie_phy_init(struct phy *phy) > +static int imx8_pcie_phy_power_on(struct phy *phy) > { > int ret; > u32 val, pad_mode; > @@ -137,14 +137,14 @@ static int imx8_pcie_phy_init(struct phy *phy) > return ret; > } > > -static int imx8_pcie_phy_power_on(struct phy *phy) > +static int imx8_pcie_phy_init(struct phy *phy) > { > struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy); > > return clk_prepare_enable(imx8_phy->clk); > } > > -static int imx8_pcie_phy_power_off(struct phy *phy) > +static int imx8_pcie_phy_exit(struct phy *phy) > { > struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy); > > @@ -155,8 +155,8 @@ static int imx8_pcie_phy_power_off(struct phy *phy) > > static const struct phy_ops imx8_pcie_phy_ops = { > .init = imx8_pcie_phy_init, > + .exit = imx8_pcie_phy_exit, > .power_on = imx8_pcie_phy_power_on, > - .power_off = imx8_pcie_phy_power_off, > .owner = THIS_MODULE, > }; > > -- > 2.25.1 > > > -- > linux-phy mailing list > linux-phy@lists.infradead.org > https://lists.infradead.org/mailman/listinfo/linux-phy