[PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up

Richard Zhu hongxing.zhu at nxp.com
Mon Oct 25 19:18:18 PDT 2021


> -----Original Message-----
> From: Mark Brown <broonie at kernel.org>
> Sent: Monday, October 25, 2021 7:24 PM
> To: Francesco Dolcini <francesco.dolcini at toradex.com>
> Cc: Richard Zhu <hongxing.zhu at nxp.com>; l.stach at pengutronix.de;
> bhelgaas at google.com; lorenzo.pieralisi at arm.com; jingoohan1 at gmail.com;
> linux-pci at vger.kernel.org; dl-linux-imx <linux-imx at nxp.com>;
> linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org;
> kernel at pengutronix.de
> Subject: Re: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never
> came up
> 
> On Mon, Oct 25, 2021 at 01:13:12PM +0200, Francesco Dolcini wrote:
> 
> > Hello Richard,
> > please see this comment from Mark,
> https://lore.kernel.org/all/YXaGve1ZJq0DGZ9l@sirena.org.uk/.
> 
> > > +		if (imx6_pcie->vpcie
> > > +		    && regulator_is_enabled(imx6_pcie->vpcie) > 0)
> > > +			regulator_disable(imx6_pcie->vpcie);
> > >  		return ret;
> 
> I should probably also say that the check for the regulator looks buggy as well,
> regulators should only be optional if they can be physically absent which does
> not seem likely for PCI devices.  If the driver is not doing something to
> reconfigure the hardware to account for a missing supply this is generally a big
> warning sign.
> 
> I really don't understand why regulator support is so frequently problematic
> for PCI controllers.  :(
[Richard Zhu] Hi Mark:
The _enabled check is used because that this regulator is optional in the HW design.
To make the codes clean and aligned on different HW boards, the _enabled check is added.

The root cause is that the error return is not handled properly by the controller driver.
I.MX PCIe controller doesn't support the Hot-Plug, and it would return -110 error
when PCIe link never came up. Thus, the _probe would be failed in the end.
The clocks/regulator usage balance should be considered by i.MX PCIe controller, that's all.
It's not a general case, and the problem is not caused by the regulator support.

Best Regards
Richard Zhu




More information about the linux-arm-kernel mailing list