aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2022-06-01 00:07:00 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-10 15:57:54 +0200
commit2f8c3ae8288e4a4018330ed5c4e758b878d9c555 (patch)
tree121b69b8ef09dede3fa4d6009bb3d803a4952777 /drivers/base/base.h
parentnet: mdio: Delete usage of driver_deferred_probe_check_state() (diff)
downloadlinux-dev-2f8c3ae8288e4a4018330ed5c4e758b878d9c555.tar.xz
linux-dev-2f8c3ae8288e4a4018330ed5c4e758b878d9c555.zip
driver core: Add wait_for_init_devices_probe helper function
Some devices might need to be probed and bound successfully before the kernel boot sequence can finish and move on to init/userspace. For example, a network interface might need to be bound to be able to mount a NFS rootfs. With fw_devlink=on by default, some of these devices might be blocked from probing because they are waiting on a optional supplier that doesn't have a driver. While fw_devlink will eventually identify such devices and unblock the probing automatically, it might be too late by the time it unblocks the probing of devices. For example, the IP4 autoconfig might timeout before fw_devlink unblocks probing of the network interface. This function is available to temporarily try and probe all devices that have a driver even if some of their suppliers haven't been added or don't have drivers. The drivers can then decide which of the suppliers are optional vs mandatory and probe the device if possible. By the time this function returns, all such "best effort" probes are guaranteed to be completed. If a device successfully probes in this mode, we delete all fw_devlink discovered dependencies of that device where the supplier hasn't yet probed successfully because they have to be optional dependencies. This also means that some devices that aren't needed for init and could have waited for their optional supplier to probe (when the supplier's module is loaded later on) would end up probing prematurely with limited functionality. So call this function only when boot would fail without it. Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20220601070707.3946847-5-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index ab71403d102f..b3a43a164dcd 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -160,6 +160,7 @@ extern int devres_release_all(struct device *dev);
extern void device_block_probing(void);
extern void device_unblock_probing(void);
extern void deferred_probe_extend_timeout(void);
+extern void driver_deferred_probe_trigger(void);
/* /sys/devices directory */
extern struct kset *devices_kset;