driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT
authorSaravana Kannan <saravanak@google.com>
Fri, 17 Mar 2023 20:51:33 +0000 (13:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Mar 2023 16:45:59 +0000 (18:45 +0200)
Add a build time equivalent of fw_devlink.sync_state=timeout so that
board specific kernels could enable it and not have to deal with setting
or cluttering the kernel commandline.

Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230317205134.964098-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/Kconfig
drivers/base/core.c

index 6f04b831a5c0416999435424c31d01c2d9eaeb76..2b8fd6bb7da0b83a6c0c98b65b68bd4072b75c59 100644 (file)
@@ -230,4 +230,16 @@ config GENERIC_ARCH_NUMA
          Enable support for generic NUMA implementation. Currently, RISC-V
          and ARM64 use it.
 
+config FW_DEVLINK_SYNC_STATE_TIMEOUT
+       bool "sync_state() behavior defaults to timeout instead of strict"
+       help
+         This is build time equivalent of adding kernel command line parameter
+         "fw_devlink.sync_state=timeout". Give up waiting on consumers and
+         call sync_state() on any devices that haven't yet received their
+         sync_state() calls after deferred_probe_timeout has expired or by
+         late_initcall() if !CONFIG_MODULES. You should almost always want to
+         select N here unless you have already successfully tested with the
+         command line option on every system/board your kernel is expected to
+         work on.
+
 endmenu
index b59692a4d809007cd1e40042204ea3fea64a5d9e..89249be22161b2523d2f7ce043a4b1ac7ac76da8 100644 (file)
@@ -1671,7 +1671,12 @@ early_param("fw_devlink.strict", fw_devlink_strict_setup);
 #define FW_DEVLINK_SYNC_STATE_STRICT   0
 #define FW_DEVLINK_SYNC_STATE_TIMEOUT  1
 
+#ifndef CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT
 static int fw_devlink_sync_state;
+#else
+static int fw_devlink_sync_state = FW_DEVLINK_SYNC_STATE_TIMEOUT;
+#endif
+
 static int __init fw_devlink_sync_state_setup(char *arg)
 {
        if (!arg)