[PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up
Mark Brown
broonie at kernel.org
Fri Oct 29 04:46:00 PDT 2021
On Fri, Oct 29, 2021 at 03:58:41AM +0000, Richard Zhu wrote:
> > The driver should undo any enables it did itself, it should not undo any
> > enables that anything else did which means it should never be basing
> > decisions on regulator_is_enabled(). While the regulator may not be
> > shared in the particular board you're looking at it may be shared in other
> > systems.
> [Richard Zhu] Understood. Thanks.
> Can I disabled this regulator in PCIe probe failure handler without the
> regulator_is_enabled() check?
If the driver called regulator_enable() (and that didn't return an
error) it can always call regulator_disable() as many times as it called
regulator_enable(), no need to check if the regulator is still enabled.
When the driver hasn't successfully called regulator_enable() it
shouldn't call regulator_disable() even if the regualtor is enabled.
This means that after your driver has enabled the regulator it can just
disable it but between the regulator_get() and regulator_enable() it
shouldn't do that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211029/5b7bafe2/attachment.sig>
More information about the linux-arm-kernel
mailing list