[PATCH v5 0/6] driver core: Improve and cleanup driver_deferred_probe_check_state()

From: John Stultz
Date: Tue Feb 25 2020 - 00:08:37 EST


This series goal is to improve and cleanup the
driver_deferred_probe_check_state() code in the driver core.

This series is useful for being able to support modules
dependencies which may be loaded by userland, far after
late_initcall is done. For instance, this series allows us to
successfully use various clk drivers as modules on the db845c
board. And without it, those drivers have to be statically built
in to work.

Since I first sent out this patch, Saravana suggested an
alternative approach which also works for our needs, and is a
bit simpler:
https://lore.kernel.org/lkml/20200220055250.196456-1-saravanak@xxxxxxxxxx/T/#u

However, while that patch provides the functionality we need,
I still suspect the driver_deferred_probe_check_state() code
could benefit from the cleanup in this patch, as the existing
logic is somewhat muddy.

New in v5:
* Reworked the driver_deferred_probe_check_state() logic as
suggested by Saravana to tie the initcall_done checking with
modules being enabled.
* Cleanup some comment wording as suggested by Rafael
* Try to slightly simplify the regulator logic as suggested by
Bjorn

Thanks so much to Bjorn, Saravana and Rafael for their reviews
and suggestions! Additional review and feedback is always greatly
appreciated!

thanks
-john

Cc: Rob Herring <robh@xxxxxxxxxx>
Cc: "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>
Cc: Kevin Hilman <khilman@xxxxxxxxxx>
Cc: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
Cc: Pavel Machek <pavel@xxxxxx>
Cc: Len Brown <len.brown@xxxxxxxxx>
Cc: Todd Kjos <tkjos@xxxxxxxxxx>
Cc: Saravana Kannan <saravanak@xxxxxxxxxx>
Cc: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>
Cc: Thierry Reding <treding@xxxxxxxxxx>
Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxx

John Stultz (6):
driver core: Fix driver_deferred_probe_check_state() logic
driver core: Set deferred_probe_timeout to a longer default if
CONFIG_MODULES is set
pinctrl: Remove use of driver_deferred_probe_check_state_continue()
driver core: Remove driver_deferred_probe_check_state_continue()
driver core: Rename deferred_probe_timeout and make it global
regulator: Use driver_deferred_probe_timeout for
regulator_init_complete_work

drivers/base/dd.c | 82 +++++++++++++----------------------
drivers/pinctrl/devicetree.c | 9 ++--
drivers/regulator/core.c | 25 ++++++-----
include/linux/device/driver.h | 2 +-
4 files changed, 49 insertions(+), 69 deletions(-)

--
2.17.1