aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/dd.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 9fa888e08059..1b1cbb571d38 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -80,8 +80,10 @@ static void deferred_probe_work_func(struct work_struct *work)
80 80
81 get_device(dev); 81 get_device(dev);
82 82
83 /* Drop the mutex while probing each device; the probe path 83 /*
84 * may manipulate the deferred list */ 84 * Drop the mutex while probing each device; the probe path may
85 * manipulate the deferred list
86 */
85 mutex_unlock(&deferred_probe_mutex); 87 mutex_unlock(&deferred_probe_mutex);
86 dev_dbg(dev, "Retrying from deferred list\n"); 88 dev_dbg(dev, "Retrying from deferred list\n");
87 bus_probe_device(dev); 89 bus_probe_device(dev);
@@ -126,16 +128,20 @@ static void driver_deferred_probe_trigger(void)
126 if (!driver_deferred_probe_enable) 128 if (!driver_deferred_probe_enable)
127 return; 129 return;
128 130
129 /* A successful probe means that all the devices in the pending list 131 /*
132 * A successful probe means that all the devices in the pending list
130 * should be triggered to be reprobed. Move all the deferred devices 133 * should be triggered to be reprobed. Move all the deferred devices
131 * into the active list so they can be retried by the workqueue */ 134 * into the active list so they can be retried by the workqueue
135 */
132 mutex_lock(&deferred_probe_mutex); 136 mutex_lock(&deferred_probe_mutex);
133 list_splice_tail_init(&deferred_probe_pending_list, 137 list_splice_tail_init(&deferred_probe_pending_list,
134 &deferred_probe_active_list); 138 &deferred_probe_active_list);
135 mutex_unlock(&deferred_probe_mutex); 139 mutex_unlock(&deferred_probe_mutex);
136 140
137 /* Kick the re-probe thread. It may already be scheduled, but 141 /*
138 * it is safe to kick it again. */ 142 * Kick the re-probe thread. It may already be scheduled, but it is
143 * safe to kick it again.
144 */
139 queue_work(deferred_wq, &deferred_probe_work); 145 queue_work(deferred_wq, &deferred_probe_work);
140} 146}
141 147
@@ -171,8 +177,10 @@ static void driver_bound(struct device *dev)
171 177
172 klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); 178 klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices);
173 179
174 /* Make sure the device is no longer in one of the deferred lists 180 /*
175 * and kick off retrying all pending devices */ 181 * Make sure the device is no longer in one of the deferred lists and
182 * kick off retrying all pending devices
183 */
176 driver_deferred_probe_del(dev); 184 driver_deferred_probe_del(dev);
177 driver_deferred_probe_trigger(); 185 driver_deferred_probe_trigger();
178 186