[PATCH v9 5/8] PCI: imx6: Refine the regulator usage

Hongxing Zhu hongxing.zhu at nxp.com
Fri Jun 10 00:09:35 PDT 2022


> -----Original Message-----
> From: Bjorn Helgaas <helgaas at kernel.org>
> Sent: 2022年6月10日 1:20
> To: Hongxing Zhu <hongxing.zhu at nxp.com>
> Cc: l.stach at pengutronix.de; bhelgaas at google.com; robh+dt at kernel.org;
> broonie at kernel.org; lorenzo.pieralisi at arm.com; jingoohan1 at gmail.com;
> festevam at gmail.com; francesco.dolcini at toradex.com;
> linux-pci at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> linux-kernel at vger.kernel.org; kernel at pengutronix.de; dl-linux-imx
> <linux-imx at nxp.com>
> Subject: Re: [PATCH v9 5/8] PCI: imx6: Refine the regulator usage
> 
> On Thu, Jun 09, 2022 at 06:19:47AM +0000, Hongxing Zhu wrote:
> > > -----Original Message-----
> > > From: Bjorn Helgaas <helgaas at kernel.org>
> > > Sent: 2022年6月9日 2:55
> > > To: Hongxing Zhu <hongxing.zhu at nxp.com>
> > > Cc: l.stach at pengutronix.de; bhelgaas at google.com; robh+dt at kernel.org;
> > > broonie at kernel.org; lorenzo.pieralisi at arm.com; jingoohan1 at gmail.com;
> > > festevam at gmail.com; francesco.dolcini at toradex.com;
> > > linux-pci at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> > > linux-kernel at vger.kernel.org; kernel at pengutronix.de; dl-linux-imx
> > > <linux-imx at nxp.com>
> > > Subject: Re: [PATCH v9 5/8] PCI: imx6: Refine the regulator usage
> > >
> > > On Fri, May 06, 2022 at 09:47:06AM +0800, Richard Zhu wrote:
> > > > The driver should undo any enables it did itself. The regulator
> > > > disable shouldn't be basing decisions on regulator_is_enabled().
> 
> The driver should disable things if an error occurs after it has enabled
> something, or if it enabled something during probe and we're now detaching
> the driver.  That doesn't look like the case here.
> 
> > > > To keep the balance of the regulator usage counter, disable the
> > > > regulator just behind of imx6_pcie_assert_core_reset() in resume
> > > > and shutdown.
> > >
> > > In subject, "Refine" doesn't tell me anything about what's happening here.
> >
> > Thanks for your comments.
> > How about the following one?
> > PCI: imx6: Do regulator disable without the regulator_is_enabled check
> 
> That's too low-level, like describing the C code line by line.
> I'm hoping for something about the purpose for the patch so "git log --oneline"
> can tell a coherent story.
> 
> Apparently this is about disabling the power regulator when the slot isn't being
> used, so maybe it could say something about that.
> 
>   $ git grep -Ep "regulator_(en|dis)able" drivers/pci/controller/
> 
> shows that in other drivers, this being done in
> probe/remove/suspend/resume-type paths.  imx6 should be similar.
> 
Got that, thanks a lot.

Best Regards
Richard Zhu

> Bjorn


More information about the linux-arm-kernel mailing list