Re: [PATCH v5 4/4] regulator: qcom-rpmh: Add debounce delay before disabling regulator
From: Jishnu Prakash
Date: Tue Nov 24 2026 - 03:08:04 EST
Hi Mark,
On 11/14/2026 4:06 AM, Mark Brown wrote:
>> Some consumers rapidly toggle a regulator off and back on, e.g. a
>> driver that disables its supply on -EPROBE_DEFER and re-enables it on
>> the next probe attempt. Sending the disable to RPMh immediately causes
>> needless power cycling of the rail.
>
> Looking at the code here this doesn't really seem at all driver specific
> - we could implement this in the core around any disable and enable
> operation. Is there anything that really ties this to the driver code,
> or could it be factored out and available to everything?
>
I think you're right, looking at all the comments now, it makes more sense
to implement this in the core than in the driver alone and there is nothing
tying it to our RPMh regulator driver specifically. I'll make the
changes to implement this feature in the core in the next patch series.
Thanks,
Jishnu
> There's also a bunch of stuff from Sashiko a lot of which looks valid
> but I didn't check it carefully.
>
>> + * @lock: Serializes disable() against the teardown
>> + * action, since both make a read-then-act decision
>> + * on @debounce_delay that must be atomic to avoid
>> + * queuing @delayed_off_work after teardown has
>> + * swept it. enable() needs no lock: its only
>> + * shared-state access is cancel_delayed_work_sync(),
>> + * which already serializes against
>> + * @delayed_off_work. @enabled and @rdev are also