Re: [PATCH 7/7] regulator: core: Remove loop disabling supplies in regulator_force_disable()

From: Doug Anderson
Date: Tue Nov 20 2018 - 11:57:51 EST


Hi,

On Tue, Nov 20, 2018 at 8:25 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> If something has been forced off the system is in very serious trouble
> and had a cricial safety problem, though the fact that there's error
> handling code that did the force disable might mean that there's some
> ability to recover the situation - for example, this might be part of
> thermal management or something like charger management. Other drivers
> do get notified if something gets forced off so a well written system
> will ensure that other users of a regulator that can get force disabled
> will have handling for this as should userspace. We don't have any such
> full systems in mainline, though - it is a really uncommon case.

OK. I guess for now I'll just change this to disable the parent
supply as many times as this individual consumer enabled it and call
it good enough? It can be for someone else to figure out how to make
it really usable for system recovery.

...I originally only ended up here since I was auditing all this code
while moving the enable count to the individual consumers...


> The usage in the Adreno drivers just looks to be another completely
> out of expectation regulator API usage in the QC code.

Yeah, looks like it.


> I do wish there
> were a way to flag API calls as needing review :(

Would it be worth adding a WARN_ON(1) splat here or at least a
"dev_warn" so people knew it wasn't really an API for general use?
...or is that going overboard?

-Doug