Re: [PATCH v3 6/9] i2c: of-prober: Defer regulator_disable() on successful probe in simple helper

Andy Shevchenko <[email protected]>
Newsgroups gmane.linux.drivers.i2c,gmane.linux.ports.arm.mediatek,gmane.linux.drivers.devicetree,gmane.linux.ports.arm.kernel,gmane.linux.kernel.input,gmane.linux.kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Wed, Jul 22, 2026 at 04:34:15PM +0800, Chen-Yu Tsai wrote:
> On Tue, Jul 21, 2026 at 6:24 PM Andy Shevchenko
> <[email protected]> wrote:
> > On Tue, Jul 21, 2026 at 03:52:20PM +0800, Chen-Yu Tsai wrote:

...

> > > +     /*
> > > +      * Wait a bit of time for async drivers to probe and increase the
> > > +      * regulator enable count. This allows the drivers to check and
> > > +      * skip waiting for re-initialization.
> > > +      */
> > > +     if (defer_disable) {
> > > +             dev_dbg(dev, "Deferring regulator disable\n");
> > > +             msleep(100);
> >
> > How was this value chosen?
> 
> I just chose an arbitrary round value.
> 
> If both the prober and the driver for the probed device (trackpad in
> this example) are builtin, the time between enabling the node and the
> driver asynchronously probing is between 5 ms and 30 ms, but could
> also see outliers exceeding 100 ms.
> 
> If you're worried the value won't suit every user, I could make it a
> parameter of the simple helpers? And the user itself could be made to
> probe asynchronously to not block the main code path.

I think the comment above should be updated to summarize the above instead of
"a bit of time".

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.