Skip to content

Commit 64c775f

Browse files
johnstultz-workgregkh
authored andcommitted
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: [email protected] 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]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Rafael J. Wysocki <[email protected]> Signed-off-by: John Stultz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0e9f8d0 commit 64c775f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

drivers/base/dd.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,19 @@ DEFINE_SHOW_ATTRIBUTE(deferred_devs);
229229
* In the case of modules, set the default probe timeout to
230230
* 30 seconds to give userland some time to load needed modules
231231
*/
232-
static int deferred_probe_timeout = 30;
232+
int driver_deferred_probe_timeout = 30;
233233
#else
234234
/* In the case of !modules, no probe timeout needed */
235-
static int deferred_probe_timeout = -1;
235+
int driver_deferred_probe_timeout = -1;
236236
#endif
237+
EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout);
238+
237239
static int __init deferred_probe_timeout_setup(char *str)
238240
{
239241
int timeout;
240242

241243
if (!kstrtoint(str, 10, &timeout))
242-
deferred_probe_timeout = timeout;
244+
driver_deferred_probe_timeout = timeout;
243245
return 1;
244246
}
245247
__setup("deferred_probe_timeout=", deferred_probe_timeout_setup);
@@ -264,7 +266,7 @@ int driver_deferred_probe_check_state(struct device *dev)
264266
return -ENODEV;
265267
}
266268

267-
if (!deferred_probe_timeout) {
269+
if (!driver_deferred_probe_timeout) {
268270
dev_WARN(dev, "deferred probe timeout, ignoring dependency");
269271
return -ETIMEDOUT;
270272
}
@@ -276,7 +278,7 @@ static void deferred_probe_timeout_work_func(struct work_struct *work)
276278
{
277279
struct device_private *private, *p;
278280

279-
deferred_probe_timeout = 0;
281+
driver_deferred_probe_timeout = 0;
280282
driver_deferred_probe_trigger();
281283
flush_work(&deferred_probe_work);
282284

@@ -310,9 +312,9 @@ static int deferred_probe_initcall(void)
310312
driver_deferred_probe_trigger();
311313
flush_work(&deferred_probe_work);
312314

313-
if (deferred_probe_timeout > 0) {
315+
if (driver_deferred_probe_timeout > 0) {
314316
schedule_delayed_work(&deferred_probe_timeout_work,
315-
deferred_probe_timeout * HZ);
317+
driver_deferred_probe_timeout * HZ);
316318
}
317319
return 0;
318320
}

include/linux/device/driver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev)
236236
}
237237
#endif
238238

239+
extern int driver_deferred_probe_timeout;
239240
void driver_deferred_probe_add(struct device *dev);
240241
int driver_deferred_probe_check_state(struct device *dev);
241242
void driver_init(void);

0 commit comments

Comments
 (0)