All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT
@ 2023-03-13 23:27 Saravana Kannan
  2023-03-14  6:12 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Saravana Kannan @ 2023-03-13 23:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: Saravana Kannan, Doug Anderson, kernel-team, linux-kernel

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>
---
 drivers/base/Kconfig | 10 ++++++++++
 drivers/base/core.c  |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 6f04b831a5c0..da91b409482f 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -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
diff --git a/drivers/base/core.c b/drivers/base/core.c
index fe74a786e2c3..adc81871829f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -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)
-- 
2.40.0.rc1.284.g88254d51c5-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT
  2023-03-13 23:27 [PATCH v1] driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT Saravana Kannan
@ 2023-03-14  6:12 ` Greg Kroah-Hartman
  2023-03-14 16:35   ` Saravana Kannan
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2023-03-14  6:12 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Rafael J. Wysocki, Doug Anderson, kernel-team, linux-kernel

On Mon, Mar 13, 2023 at 04:27:19PM -0700, Saravana Kannan wrote:
> 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>
> ---
>  drivers/base/Kconfig | 10 ++++++++++
>  drivers/base/core.c  |  5 +++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> index 6f04b831a5c0..da91b409482f 100644
> --- a/drivers/base/Kconfig
> +++ b/drivers/base/Kconfig
> @@ -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.

> +	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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT
  2023-03-14  6:12 ` Greg Kroah-Hartman
@ 2023-03-14 16:35   ` Saravana Kannan
  0 siblings, 0 replies; 3+ messages in thread
From: Saravana Kannan @ 2023-03-14 16:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Doug Anderson, kernel-team, linux-kernel

On Mon, Mar 13, 2023 at 11:12 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Mon, Mar 13, 2023 at 04:27:19PM -0700, Saravana Kannan wrote:
> > 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>
> > ---
> >  drivers/base/Kconfig | 10 ++++++++++
> >  drivers/base/core.c  |  5 +++++
> >  2 files changed, 15 insertions(+)
> >
> > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> > index 6f04b831a5c0..da91b409482f 100644
> > --- a/drivers/base/Kconfig
> > +++ b/drivers/base/Kconfig
> > @@ -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.

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

>
> > +     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.

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-14 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 23:27 [PATCH v1] driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT Saravana Kannan
2023-03-14  6:12 ` Greg Kroah-Hartman
2023-03-14 16:35   ` Saravana Kannan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.