lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AS8PR04MB8676A0F3DA3248C6A27801148C849@AS8PR04MB8676.eurprd04.prod.outlook.com>
Date:   Tue, 26 Oct 2021 02:18:18 +0000
From:   Richard Zhu <hongxing.zhu@....com>
To:     Mark Brown <broonie@...nel.org>,
        Francesco Dolcini <francesco.dolcini@...adex.com>
CC:     "l.stach@...gutronix.de" <l.stach@...gutronix.de>,
        "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
        "lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>,
        "jingoohan1@...il.com" <jingoohan1@...il.com>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: RE: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never
 came up

> -----Original Message-----
> From: Mark Brown <broonie@...nel.org>
> Sent: Monday, October 25, 2021 7:24 PM
> To: Francesco Dolcini <francesco.dolcini@...adex.com>
> Cc: Richard Zhu <hongxing.zhu@....com>; l.stach@...gutronix.de;
> bhelgaas@...gle.com; lorenzo.pieralisi@....com; jingoohan1@...il.com;
> linux-pci@...r.kernel.org; dl-linux-imx <linux-imx@....com>;
> linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org;
> kernel@...gutronix.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ