Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: Rename deferred_probe_timeout and make it global

Since other subsystems (like regulator) have similar arbitrary
timeouts for how long they try to resolve driver dependencies,
rename deferred_probe_timeout to driver_deferred_probe_timeout
and set it as global, so it can be shared.

Cc: linux-pm@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Saravana Kannan <saravanak@google.com>
Cc: Todd Kjos <tkjos@google.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Rob Herring <robh@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Link: https://lore.kernel.org/r/20200225050828.56458-6-john.stultz@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

John Stultz and committed by
Greg Kroah-Hartman
64c775fb 0e9f8d09

+10 -7
+9 -7
drivers/base/dd.c
··· 229 229 * In the case of modules, set the default probe timeout to 230 230 * 30 seconds to give userland some time to load needed modules 231 231 */ 232 - static int deferred_probe_timeout = 30; 232 + int driver_deferred_probe_timeout = 30; 233 233 #else 234 234 /* In the case of !modules, no probe timeout needed */ 235 - static int deferred_probe_timeout = -1; 235 + int driver_deferred_probe_timeout = -1; 236 236 #endif 237 + EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout); 238 + 237 239 static int __init deferred_probe_timeout_setup(char *str) 238 240 { 239 241 int timeout; 240 242 241 243 if (!kstrtoint(str, 10, &timeout)) 242 - deferred_probe_timeout = timeout; 244 + driver_deferred_probe_timeout = timeout; 243 245 return 1; 244 246 } 245 247 __setup("deferred_probe_timeout=", deferred_probe_timeout_setup); ··· 266 264 return -ENODEV; 267 265 } 268 266 269 - if (!deferred_probe_timeout) { 267 + if (!driver_deferred_probe_timeout) { 270 268 dev_WARN(dev, "deferred probe timeout, ignoring dependency"); 271 269 return -ETIMEDOUT; 272 270 } ··· 278 276 { 279 277 struct device_private *private, *p; 280 278 281 - deferred_probe_timeout = 0; 279 + driver_deferred_probe_timeout = 0; 282 280 driver_deferred_probe_trigger(); 283 281 flush_work(&deferred_probe_work); 284 282 ··· 312 310 driver_deferred_probe_trigger(); 313 311 flush_work(&deferred_probe_work); 314 312 315 - if (deferred_probe_timeout > 0) { 313 + if (driver_deferred_probe_timeout > 0) { 316 314 schedule_delayed_work(&deferred_probe_timeout_work, 317 - deferred_probe_timeout * HZ); 315 + driver_deferred_probe_timeout * HZ); 318 316 } 319 317 return 0; 320 318 }
+1
include/linux/device/driver.h
··· 236 236 } 237 237 #endif 238 238 239 + extern int driver_deferred_probe_timeout; 239 240 void driver_deferred_probe_add(struct device *dev); 240 241 int driver_deferred_probe_check_state(struct device *dev); 241 242 void driver_init(void);