Skip to contentSkip to conversation

driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT

PATCH Superseded Saravana Kannan 2 participants 3 messages Mar 13, 2023 – Mar 14, 2023 Driver core

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT

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.

---
 drivers/base/Kconfig | 10 ++++++++++
 drivers/base/core.c  |  5 +++++
 2 files changed, 15 insertions(+)
drivers/base/Kconfig +10 -0
index 6f04b831a5c0..da91b409482f 100644
@@ -230,4 +230,14 @@ config GENERIC_ARCH_NUMA
 	  Enable support for generic NUMA implementation. Currently, RISC-V
 	  and ARM64 use it.
 
+config FW_DEVLINK_SYNC_STATE_TIMEOUT
+	bool
+	default n
+	help
+	  This is build time equivalent of adding kernel commandline 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.
+
 endmenu
drivers/base/core.c +5 -0
index fe74a786e2c3..adc81871829f 100644
@@ -1672,7 +1672,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)
Signature · 1 line
2.40.0.rc1.284.g88254d51c5-goog
#1 lore raw
Quoted 16 lines · Saravana Kannan

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.

---
 drivers/base/Kconfig | 10 ++++++++++
 drivers/base/core.c  |  5 +++++
 2 files changed, 15 insertions(+)
drivers/base/Kconfig +0 -0
index 6f04b831a5c0..da91b409482f 100644

drivers/base/Kconfig config GENERIC_ARCH_NUMA · line 235

Quoted 6 lines
drivers/base/Kconfig +3 -0
@@ -230,4 +230,14 @@ config GENERIC_ARCH_NUMA
 	  Enable support for generic NUMA implementation. Currently, RISC-V
 	  and ARM64 use it.
 
+config FW_DEVLINK_SYNC_STATE_TIMEOUT
+	bool
+	default n

n is always the default, no need to say it here again.

drivers/base/Kconfig config GENERIC_ARCH_NUMA · line 241

Quoted 6 lines
drivers/base/Kconfig +6 -0
+	help
+	  This is build time equivalent of adding kernel commandline 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.

I think you forgot a noun in this last sentence :)

And add something like "You should almost always want to select N here unless you have successfully tested with this command line option already"

thanks,

greg k-h

#2 lore raw
Quoted 21 lines · Greg Kroah-Hartman
Quoted 19 lines · Saravana Kannan

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.

---
 drivers/base/Kconfig | 10 ++++++++++
 drivers/base/core.c  |  5 +++++
 2 files changed, 15 insertions(+)
drivers/base/Kconfig +0 -0
index 6f04b831a5c0..da91b409482f 100644
@@ -230,4 +230,14 @@ config GENERIC_ARCH_NUMA
        Enable support for generic NUMA implementation. Currently, RISC-V
        and ARM64 use it.
 
Quoted 5 lines

drivers/base/Kconfig config GENERIC_ARCH_NUMA · line 235

Quoted 3 lines
drivers/base/Kconfig +3 -0
+config FW_DEVLINK_SYNC_STATE_TIMEOUT
+     bool
+     default n

n is always the default, no need to say it here again.

Ok, that's what I thought, but then I got confused by the other default n in that file. I'll fix this.

Quoted 9 lines

drivers/base/Kconfig config GENERIC_ARCH_NUMA · line 241

Quoted 7 lines
drivers/base/Kconfig +6 -0
+     help
+       This is build time equivalent of adding kernel commandline 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.

I think you forgot a noun in this last sentence :)

Hmm... reads okay to me. I'm open to suggestions if you want to tell me exactly what to put in here.

Quoted 3 lines

And add something like "You should almost always want to select N here unless you have successfully tested with this command line option already"

Will do.

-Saravana