]> Git Repo - linux.git/commit
driver core: Fix driver_deferred_probe_check_state() logic
authorJohn Stultz <[email protected]>
Tue, 25 Feb 2020 05:08:23 +0000 (05:08 +0000)
committerGreg Kroah-Hartman <[email protected]>
Wed, 4 Mar 2020 17:11:44 +0000 (18:11 +0100)
commitc8c43cee29f6ca2575c953ae600263690db28f41
tree5be9b1416296cd29c26d38638ff2320de182697a
parente94f62b7140fa3da4c69a685b2e73ef52dd32c51
driver core: Fix driver_deferred_probe_check_state() logic

driver_deferred_probe_check_state() has some uninituitive behavior.

* From boot to late_initcall, it returns -EPROBE_DEFER

* From late_initcall to the deferred_probe_timeout (if set)
  it returns -ENODEV

* If the deferred_probe_timeout it set, after it fires, it
  returns -ETIMEDOUT

This is a bit confusing, as its useful to have the function
return -EPROBE_DEFER while the timeout is still running. This
behavior has resulted in the somwhat duplicative
driver_deferred_probe_check_state_continue() function being
added.

Thus this patch tries to improve the logic, so that it behaves
as such:

* If late_initcall has passed, and modules are not enabled
  it returns -ENODEV

* If modules are enabled and deferred_probe_timeout is set,
  it returns -EPROBE_DEFER until the timeout, afterwhich it
  returns -ETIMEDOUT.

* In all other cases, it returns -EPROBE_DEFER

This will make the deferred_probe_timeout value much more
functional, and will allow us to consolidate the
driver_deferred_probe_check_state() and
driver_deferred_probe_check_state_continue() logic in a later
patch.

Cc: [email protected]
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Todd Kjos <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Rob Herring <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/base/dd.c
This page took 0.054386 seconds and 4 git commands to generate.