Commit 13a8e0f6 authored by Saravana Kannan's avatar Saravana Kannan Committed by Greg Kroah-Hartman

Revert "driver core: Delete driver_deferred_probe_check_state()"

This reverts commit 9cbffc7a.

There are a few more issues to fix that have been reported in the thread
for the original series [1]. We'll need to fix those before this will work.
So, revert it for now.

[1] - https://lore.kernel.org/lkml/20220601070707.3946847-1-saravanak@google.com/

Fixes: 9cbffc7a ("driver core: Delete driver_deferred_probe_check_state()")
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Tested-by: default avatarPeng Fan <peng.fan@nxp.com>
Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
Tested-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20220819221616.2107893-2-saravanak@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1c23f9e6
...@@ -274,12 +274,42 @@ static int __init deferred_probe_timeout_setup(char *str) ...@@ -274,12 +274,42 @@ static int __init deferred_probe_timeout_setup(char *str)
} }
__setup("deferred_probe_timeout=", deferred_probe_timeout_setup); __setup("deferred_probe_timeout=", deferred_probe_timeout_setup);
/**
* driver_deferred_probe_check_state() - Check deferred probe state
* @dev: device to check
*
* Return:
* * -ENODEV if initcalls have completed and modules are disabled.
* * -ETIMEDOUT if the deferred probe timeout was set and has expired
* and modules are enabled.
* * -EPROBE_DEFER in other cases.
*
* Drivers or subsystems can opt-in to calling this function instead of directly
* returning -EPROBE_DEFER.
*/
int driver_deferred_probe_check_state(struct device *dev)
{
if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) {
dev_warn(dev, "ignoring dependency for device, assuming no driver\n");
return -ENODEV;
}
if (!driver_deferred_probe_timeout && initcalls_done) {
dev_warn(dev, "deferred probe timeout, ignoring dependency\n");
return -ETIMEDOUT;
}
return -EPROBE_DEFER;
}
EXPORT_SYMBOL_GPL(driver_deferred_probe_check_state);
static void deferred_probe_timeout_work_func(struct work_struct *work) static void deferred_probe_timeout_work_func(struct work_struct *work)
{ {
struct device_private *p; struct device_private *p;
fw_devlink_drivers_done(); fw_devlink_drivers_done();
driver_deferred_probe_timeout = 0;
driver_deferred_probe_trigger(); driver_deferred_probe_trigger();
flush_work(&deferred_probe_work); flush_work(&deferred_probe_work);
......
...@@ -242,6 +242,7 @@ driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev) ...@@ -242,6 +242,7 @@ driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev)
extern int driver_deferred_probe_timeout; extern int driver_deferred_probe_timeout;
void driver_deferred_probe_add(struct device *dev); void driver_deferred_probe_add(struct device *dev);
int driver_deferred_probe_check_state(struct device *dev);
void driver_init(void); void driver_init(void);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment