diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-07-18 13:59:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 00:08:40 -0400 |
commit | d779249ed4cb3b50690de6de8448829d65a1cd08 (patch) | |
tree | 0494df3b68a28ce0b23a1577758b583409621a7d /include | |
parent | f20a9ead0d005fbeeae3fc21a96f9bf197ac1c1c (diff) |
Driver Core: add ability for drivers to do a threaded probe
This adds the infrastructure for drivers to do a threaded probe, and
waits at init time for all currently outstanding probes to complete.
A new kernel thread will be created when the probe() function for the
driver is called, if the multithread_probe bit is set in the driver
saying it can support this kind of operation.
I have tested this with USB and PCI, and it works, and shaves off a lot
of time in the boot process, but there are issues with finding root boot
disks, and some USB drivers assume that this can never happen, so it is
currently not enabled for any bus type. Individual drivers can enable
this right now if they wish, and bus authors can selectivly turn it on
as well, once they determine that their subsystem will work properly
with it.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index b3da9a870cfc..74246efba931 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -106,6 +106,8 @@ struct device_driver { | |||
106 | void (*shutdown) (struct device * dev); | 106 | void (*shutdown) (struct device * dev); |
107 | int (*suspend) (struct device * dev, pm_message_t state); | 107 | int (*suspend) (struct device * dev, pm_message_t state); |
108 | int (*resume) (struct device * dev); | 108 | int (*resume) (struct device * dev); |
109 | |||
110 | unsigned int multithread_probe:1; | ||
109 | }; | 111 | }; |
110 | 112 | ||
111 | 113 | ||
@@ -115,6 +117,7 @@ extern void driver_unregister(struct device_driver * drv); | |||
115 | extern struct device_driver * get_driver(struct device_driver * drv); | 117 | extern struct device_driver * get_driver(struct device_driver * drv); |
116 | extern void put_driver(struct device_driver * drv); | 118 | extern void put_driver(struct device_driver * drv); |
117 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | 119 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); |
120 | extern int driver_probe_done(void); | ||
118 | 121 | ||
119 | /* driverfs interface for exporting driver attributes */ | 122 | /* driverfs interface for exporting driver attributes */ |
120 | 123 | ||