Re: [PATCH v3 2/2] driver core: Make deferred_probe_timeout global so it can be shared

From: Mark Brown
Date: Wed Feb 19 2020 - 06:59:46 EST


On Tue, Feb 18, 2020 at 10:07:48PM +0000, John Stultz wrote:
> This patch, suggested by Rob, allows deferred_probe_timeout to
> be global so other substems can use it.

> This also sets the default to 30 instead of -1 (no timeout) and
> modifies the regulator code to make use of it instead of its
> hard-coded 30 second interval.

This is at least two patches, one adding the new feature and the other
adding a user of that feature.

> @@ -5767,18 +5772,17 @@ static int __init regulator_init_complete(void)
> has_full_constraints = true;
>
> /*
> - * We punt completion for an arbitrary amount of time since
> + * We punt completion for deferred_probe_timeout seconds since
> * systems like distros will load many drivers from userspace
> * so consumers might not always be ready yet, this is
> * particularly an issue with laptops where this might bounce

While I don't see it doing any harm I'm not 100% convinced by this
change - we're not really doing anything directly to do with deferred
probe here, we're shutting off regulators that remain unused late in
boot but even then they'll still be available for use. It feels a bit
unclear and the way you've adapted the code to always have a timeout
even if the deferred probe timeout gets changed feels a bit off. If
nothing else this comment needs more of an update than you've done.

Attachment: signature.asc
Description: PGP signature