Skip to contentSkip to conversation

driver core: remove polling for driver_probe_done(v5)

PATCH New [email protected] 1 participant 1 message Feb 21, 2009 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: remove polling for driver_probe_done(v5)

From: Ming Lei <[email protected]>

This patch removes 100ms polling for driver_probe_done in wait_for_device_probe(), and uses wait_event() instead. Removing polling in fs initialization may lead to a faster boot.

This patch also changes the return type of wait_for_device_done() from int to void.

This patch is against Arjan's patch in linux-next tree.

---
 drivers/base/dd.c      |    8 ++------
 include/linux/device.h |    2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)
drivers/base/dd.c +2 -6
index 62a31b9..f17c326 100644
@@ -172,16 +172,12 @@ int driver_probe_done(void)
 /**
  * wait_for_device_probe
  * Wait for device probing to be completed.
- *
- * Note: this function polls at 100 msec intervals.
  */
-int wait_for_device_probe(void)
+void wait_for_device_probe(void)
 {
 	/* wait for the known devices to complete their probing */
-	while (driver_probe_done() != 0)
-		msleep(100);
+	wait_event(probe_waitqueue, atomic_read(&probe_count) == 0);
 	async_synchronize_full();
-	return 0;
 }
 
 /**
include/linux/device.h +1 -1
index f6d6270..723e7b2 100644
@@ -148,7 +148,7 @@ extern void put_driver(struct device_driver *drv);
 extern struct device_driver *driver_find(const char *name,
 					 struct bus_type *bus);
 extern int driver_probe_done(void);
-extern int wait_for_device_probe(void);
+extern void wait_for_device_probe(void);
 
 
 /* sysfs interface for exporting driver attributes */
Signature · 1 line
1.6.0.GIT