Re: [PATCH v7 6/8] i2c: of-prober: Defer regulator_disable() on successful probe in simple helper
From: Wolfram Sang
Date: Tue Nov 10 2026 - 06:29:19 EST
On Tue, Nov 03, 2026 at 12:37:30PM +0800, Chen-Yu Tsai wrote:
> When a I2C component is found, its device node is immediately enabled.
> This triggers device creation and driver binding. The prober will hold
> the regulator enable reference across this part. If the driver probes
> synchronously, then it happens within this window. On the other hand,
> if the driver probes asynchronously, there is a high chance that it
> happens after the prober's cleanup function was called, in which case
> the regulator would have been disabled when the driver's probe function
> is called. This would then require the driver to wait 100 ms for the
> hardware to reinitialize, even if the probe function was just a split
> second late and the regulator was disabled a few milliseconds ago.
>
> Recently, some of the drivers for the components that are targeted by the
> I2C OF component prober gained the ability to skip waiting for hardware
> initialization if the regulator was left enabled. This happens when the
> PMIC has them on by default, or if the component prober left them on
> after probing the component.
>
> Tests on the Hana Chromebook showed that if the prober and trackpad
> drivers are both builtin, then the time between the prober enabling the
> device node and the trackpad driver asynchronously probing is between
> 5 ms and 30 ms, though sometimes there are outliers exceeding 100 ms.
>
> Wait 100 ms before dropping the enable refcount on our end so that the
> actual driver has the opportunity to catch and increase the refcount on
> their end.
>
> Signed-off-by: Chen-Yu Tsai <wenst@xxxxxxxxxxxx>
Acked-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>