Skip to content

Commit cec72f3

Browse files
Saravana Kannangregkh
authored andcommitted
driver core: Don't do deferred probe in parallel with kernel_init thread
The current deferred probe implementation can mess up suspend/resume ordering if deferred probe thread is kicked off in parallel with the main initcall thread (kernel_init thread) [1]. For example: Say device-B is a consumer of device-A. Initcall thread Deferred probe thread =============== ===================== 1. device-A is added. 2. device-B is added. 3. dpm_list is now [device-A, device-B]. 4. driver-A defers probe of device-A. 5. device-A is moved to end of dpm_list 6. dpm_list is now [device-B, device-A] 7. driver-B is registereed and probes device-B. 8. dpm_list stays as [device-B, device-A]. The reverse order of dpm_list is used for suspend. So in this case device-A would incorrectly get suspended before device-B. Commit 716a7a2 ("driver core: fw_devlink: Add support for batching fwnode parsing") kicked off the deferred probe thread early during boot to run in parallel with the initcall thread and caused suspend/resume regressions. This patch removes the parallel run of the deferred probe thread to avoid the suspend/resume regressions. [1] - https://lore.kernel.org/lkml/CAGETcx8W96KAw-d_siTX4qHB_-7ddk0miYRDQeHE6E0_8qx-6Q@mail.gmail.com/ Fixes: 716a7a2 ("driver core: fw_devlink: Add support for batching fwnode parsing") Signed-off-by: Saravana Kannan <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9ebcfad commit cec72f3

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

drivers/base/base.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ extern char *make_class_name(const char *name, struct kobject *kobj);
153153
extern int devres_release_all(struct device *dev);
154154
extern void device_block_probing(void);
155155
extern void device_unblock_probing(void);
156-
extern void driver_deferred_probe_force_trigger(void);
157156

158157
/* /sys/devices directory */
159158
extern struct kset *devices_kset;

drivers/base/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,6 @@ void fw_devlink_resume(void)
13231323
goto out;
13241324

13251325
device_link_add_missing_supplier_links();
1326-
driver_deferred_probe_force_trigger();
13271326
out:
13281327
mutex_unlock(&defer_fw_devlink_lock);
13291328
}

drivers/base/dd.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ static void driver_deferred_probe_trigger(void)
164164
if (!driver_deferred_probe_enable)
165165
return;
166166

167-
driver_deferred_probe_force_trigger();
168-
}
169-
170-
void driver_deferred_probe_force_trigger(void)
171-
{
172167
/*
173168
* A successful probe means that all the devices in the pending list
174169
* should be triggered to be reprobed. Move all the deferred devices

0 commit comments

Comments
 (0)