aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt4
-rw-r--r--drivers/base/dd.c24
2 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 858b6c0b9a15..dba164bbcc1a 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -910,6 +910,10 @@
910 The filter can be disabled or changed to another 910 The filter can be disabled or changed to another
911 driver later using sysfs. 911 driver later using sysfs.
912 912
913 driver_async_probe= [KNL]
914 List of driver names to be probed asynchronously.
915 Format: <driver_name1>,<driver_name2>...
916
913 drm.edid_firmware=[<connector>:]<file>[,[<connector>:]<file>] 917 drm.edid_firmware=[<connector>:]<file>[,[<connector>:]<file>]
914 Broken monitors, graphic adapters, KVMs and EDIDless 918 Broken monitors, graphic adapters, KVMs and EDIDless
915 panels may send no or incorrect EDID data sets. 919 panels may send no or incorrect EDID data sets.
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 348fc4695d4d..a823f469e53f 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -57,6 +57,10 @@ static atomic_t deferred_trigger_count = ATOMIC_INIT(0);
57static struct dentry *deferred_devices; 57static struct dentry *deferred_devices;
58static bool initcalls_done; 58static bool initcalls_done;
59 59
60/* Save the async probe drivers' name from kernel cmdline */
61#define ASYNC_DRV_NAMES_MAX_LEN 256
62static char async_probe_drv_names[ASYNC_DRV_NAMES_MAX_LEN];
63
60/* 64/*
61 * In some cases, like suspend to RAM or hibernation, It might be reasonable 65 * In some cases, like suspend to RAM or hibernation, It might be reasonable
62 * to prohibit probing of devices as it could be unsafe. 66 * to prohibit probing of devices as it could be unsafe.
@@ -674,6 +678,23 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
674 return ret; 678 return ret;
675} 679}
676 680
681static inline bool cmdline_requested_async_probing(const char *drv_name)
682{
683 return parse_option_str(async_probe_drv_names, drv_name);
684}
685
686/* The option format is "driver_async_probe=drv_name1,drv_name2,..." */
687static int __init save_async_options(char *buf)
688{
689 if (strlen(buf) >= ASYNC_DRV_NAMES_MAX_LEN)
690 printk(KERN_WARNING
691 "Too long list of driver names for 'driver_async_probe'!\n");
692
693 strlcpy(async_probe_drv_names, buf, ASYNC_DRV_NAMES_MAX_LEN);
694 return 0;
695}
696__setup("driver_async_probe=", save_async_options);
697
677bool driver_allows_async_probing(struct device_driver *drv) 698bool driver_allows_async_probing(struct device_driver *drv)
678{ 699{
679 switch (drv->probe_type) { 700 switch (drv->probe_type) {
@@ -684,6 +705,9 @@ bool driver_allows_async_probing(struct device_driver *drv)
684 return false; 705 return false;
685 706
686 default: 707 default:
708 if (cmdline_requested_async_probing(drv->name))
709 return true;
710
687 if (module_requested_async_probing(drv->owner)) 711 if (module_requested_async_probing(drv->owner))
688 return true; 712 return true;
689 713