Skip to contentSkip to conversation

regulator: Revert "Use driver_deferred_probe_timeout for regulator_init_complete_work"

PATCH In review John Stultz 3 participants 3 messages Apr 29, 2020 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: Revert "Use driver_deferred_probe_timeout for regulator_init_complete_work"

This reverts commit dca0b44957e5 ("regulator: Use driver_deferred_probe_timeout for regulator_init_complete_work"), as we ended up reverting the default deferred_probe_timeout value back to zero, to preserve behavior with 5.6 we need to decouple the regulator timeout which was previously 30 seconds.

This avoids breaking some systems that depend on the regulator timeout but don't require the deferred probe timeout.

Cc Greg Kroah-Hartman <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Ulf Hansson <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Rob Herring <[email protected]>
---
 drivers/regulator/core.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/regulator/core.c +11 -14
index c340505150b6..7486f6e4e613 100644
@@ -5754,10 +5754,6 @@ static DECLARE_DELAYED_WORK(regulator_init_complete_work,
 
 static int __init regulator_init_complete(void)
 {
-	int delay = driver_deferred_probe_timeout;
-
-	if (delay < 0)
-		delay = 0;
 	/*
 	 * Since DT doesn't provide an idiomatic mechanism for
 	 * enabling full constraints and since it's much more natural
@@ -5768,17 +5764,18 @@ static int __init regulator_init_complete(void)
 		has_full_constraints = true;
 
 	/*
-	 * If driver_deferred_probe_timeout is set, we punt
-	 * completion for that many 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 the display off
-	 * then on.  Ideally we'd get a notification from userspace
-	 * when this happens but we don't so just wait a bit and hope
-	 * we waited long enough.  It'd be better if we'd only do
-	 * this on systems that need it.
+	 * We punt completion for an arbitrary amount of time 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
+	 * the display off then on.  Ideally we'd get a notification
+	 * from userspace when this happens but we don't so just wait
+	 * a bit and hope we waited long enough.  It'd be better if
+	 * we'd only do this on systems that need it, and a kernel
+	 * command line option might be useful.
 	 */
-	schedule_delayed_work(&regulator_init_complete_work, delay * HZ);
+	schedule_delayed_work(&regulator_init_complete_work,
+			      msecs_to_jiffies(30000));
 
 	return 0;
 }
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · John Stultz

This reverts commit dca0b44957e5 ("regulator: Use driver_deferred_probe_timeout for regulator_init_complete_work"), as we ended up reverting the default deferred_probe_timeout value back to zero, to preserve behavior with 5.6 we need to decouple the regulator timeout which was previously 30 seconds.

This avoids breaking some systems that depend on the regulator timeout but don't require the deferred probe timeout.

I'm assuming this should go via the same path that the other revert went.

#2 lore raw
Quoted 7 lines · Mark Brown
Quoted 6 lines · John Stultz

This reverts commit dca0b44957e5 ("regulator: Use driver_deferred_probe_timeout for regulator_init_complete_work"), as we ended up reverting the default deferred_probe_timeout value back to zero, to preserve behavior with 5.6 we need to decouple the regulator timeout which was previously 30 seconds.

Quoted 7 lines
Quoted 2 lines

This avoids breaking some systems that depend on the regulator timeout but don't require the deferred probe timeout.

I'm assuming this should go via the same path that the other revert went.

I'll be glad to take it that way :)

thanks,

greg k-h