lkml.org 
[lkml]   [2015]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 02/13] driver-core: defer all probes until late_initcall
Date
To decrease the chances of devices deferring their probes because of
dependencies not having probed yet because of their drivers not having
registered yet, delay all probing until the late initcall level.

This will allow us to avoid deferred probes completely later by probing
dependencies on demand, or by probing them in dependency order.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
drivers/base/dd.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index a638bbb..18438aa 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -407,6 +407,12 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
if (!device_is_registered(dev))
return -ENODEV;

+ /* Defer all probes until we start processing the queue */
+ if (!driver_deferred_probe_enable) {
+ driver_deferred_probe_add(dev);
+ return 0;
+ }
+
pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
drv->bus->name, __func__, dev_name(dev), drv->name);

@@ -585,7 +591,7 @@ EXPORT_SYMBOL_GPL(device_attach);

void device_initial_probe(struct device *dev)
{
- __device_attach(dev, true);
+ __device_attach(dev, driver_deferred_probe_enable);
}

static int __driver_attach(struct device *dev, void *data)
--
2.4.1


\
 
 \ /
  Last update: 2015-06-17 16:01    [W:0.219 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site