linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off
@ 2022-03-03  6:34 Richard Zhu
  2022-03-16  9:37 ` Lucas Stach
  2022-03-17  8:58 ` Lorenzo Pieralisi
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Zhu @ 2022-03-03  6:34 UTC (permalink / raw)
  To: l.stach, bhelgaas, lorenzo.pieralisi
  Cc: linux-pci, linux-arm-kernel, linux-kernel, kernel, linux-imx,
	Richard Zhu

To balance phy->init_count, invoke the phy_exit() after phy_power_off().

Fixes: 178e244cb6e2 ("PCI: imx: Add the imx8mm pcie support")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 drivers/pci/controller/dwc/pci-imx6.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 331490614d55..343fe1429e3c 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -973,6 +973,7 @@ static int imx6_pcie_suspend_noirq(struct device *dev)
 	case IMX8MM:
 		if (phy_power_off(imx6_pcie->phy))
 			dev_err(dev, "unable to power off PHY\n");
+		phy_exit(imx6_pcie->phy);
 		break;
 	default:
 		break;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off
  2022-03-03  6:34 [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off Richard Zhu
@ 2022-03-16  9:37 ` Lucas Stach
  2022-03-17  0:29   ` Hongxing Zhu
  2022-03-17  8:58 ` Lorenzo Pieralisi
  1 sibling, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2022-03-16  9:37 UTC (permalink / raw)
  To: Richard Zhu, bhelgaas, lorenzo.pieralisi
  Cc: linux-pci, linux-arm-kernel, linux-kernel, kernel, linux-imx

Am Donnerstag, dem 03.03.2022 um 14:34 +0800 schrieb Richard Zhu:
> To balance phy->init_count, invoke the phy_exit() after phy_power_off().
> 
This looks okay as a fix, but overall I don't like that we need to have
special PHY handling in the suspend path and PHY init hidden in
imx6_pcie_assert_core_reset() in the resume path. Maybe we can make
this PHY handling a bit more obvious by splitting it out of the core
reset sequence. I don't see the full implications of such a change yet,
but I think we should at least give it a try.

For now, this patch is:
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> Fixes: 178e244cb6e2 ("PCI: imx: Add the imx8mm pcie support")
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 331490614d55..343fe1429e3c 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -973,6 +973,7 @@ static int imx6_pcie_suspend_noirq(struct device *dev)
>  	case IMX8MM:
>  		if (phy_power_off(imx6_pcie->phy))
>  			dev_err(dev, "unable to power off PHY\n");
> +		phy_exit(imx6_pcie->phy);
>  		break;
>  	default:
>  		break;



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off
  2022-03-16  9:37 ` Lucas Stach
@ 2022-03-17  0:29   ` Hongxing Zhu
  0 siblings, 0 replies; 4+ messages in thread
From: Hongxing Zhu @ 2022-03-17  0:29 UTC (permalink / raw)
  To: Lucas Stach, bhelgaas, lorenzo.pieralisi
  Cc: linux-pci, linux-arm-kernel, linux-kernel, kernel, dl-linux-imx

> -----Original Message-----
> From: Lucas Stach <l.stach@pengutronix.de>
> Sent: 2022年3月16日 17:38
> To: Hongxing Zhu <hongxing.zhu@nxp.com>; bhelgaas@google.com;
> lorenzo.pieralisi@arm.com
> Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; kernel@pengutronix.de; dl-linux-imx
> <linux-imx@nxp.com>
> Subject: Re: [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power
> off
> 
> Am Donnerstag, dem 03.03.2022 um 14:34 +0800 schrieb Richard Zhu:
> > To balance phy->init_count, invoke the phy_exit() after phy_power_off().
> >
> This looks okay as a fix, but overall I don't like that we need to have special PHY
> handling in the suspend path and PHY init hidden in
> imx6_pcie_assert_core_reset() in the resume path. Maybe we can make this
> PHY handling a bit more obvious by splitting it out of the core reset sequence. I
> don't see the full implications of such a change yet, but I think we should at
> least give it a try.
> 
> For now, this patch is:
> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Hi Lucas:
Thanks for your review comment.
Agree with you, the PHY handling shouldn't be include in the reset function.
I would plan to refine the PHY handling after this fix.

Best Regards
Richard Zhu

> 
> > Fixes: 178e244cb6e2 ("PCI: imx: Add the imx8mm pcie support")
> > Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> > ---
> >  drivers/pci/controller/dwc/pci-imx6.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-imx6.c
> > b/drivers/pci/controller/dwc/pci-imx6.c
> > index 331490614d55..343fe1429e3c 100644
> > --- a/drivers/pci/controller/dwc/pci-imx6.c
> > +++ b/drivers/pci/controller/dwc/pci-imx6.c
> > @@ -973,6 +973,7 @@ static int imx6_pcie_suspend_noirq(struct device
> *dev)
> >  	case IMX8MM:
> >  		if (phy_power_off(imx6_pcie->phy))
> >  			dev_err(dev, "unable to power off PHY\n");
> > +		phy_exit(imx6_pcie->phy);
> >  		break;
> >  	default:
> >  		break;
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off
  2022-03-03  6:34 [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off Richard Zhu
  2022-03-16  9:37 ` Lucas Stach
@ 2022-03-17  8:58 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2022-03-17  8:58 UTC (permalink / raw)
  To: bhelgaas, l.stach, Richard Zhu
  Cc: Lorenzo Pieralisi, kernel, linux-kernel, linux-pci, linux-imx,
	linux-arm-kernel

On Thu, 3 Mar 2022 14:34:35 +0800, Richard Zhu wrote:
> To balance phy->init_count, invoke the phy_exit() after phy_power_off().
> 
> 

Applied to pci/imx6, thanks!

[1/1] PCI: imx6: Invoke the PHY exit function after PHY power off
      https://git.kernel.org/lpieralisi/pci/c/deaf7a2c2e

Thanks,
Lorenzo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-17  8:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03  6:34 [PATCH] PCI: imx6: Invoke the PHY exit function after PHY power off Richard Zhu
2022-03-16  9:37 ` Lucas Stach
2022-03-17  0:29   ` Hongxing Zhu
2022-03-17  8:58 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).