linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: core: make default autosuspend delay configurable
@ 2019-03-01 14:26 Mans Rullgard
  2019-03-01 16:23 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Mans Rullgard @ 2019-03-01 14:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

Make the default autosuspend delay configurable at build time.
This is useful for systems that require a non-standard value as
it avoids relying on the command line being properly set.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/usb/core/Kconfig | 8 ++++++++
 drivers/usb/core/usb.c   | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 4d75d9a80001..38ed837538c4 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -90,3 +90,11 @@ config USB_LEDS_TRIGGER_USBPORT
 	  This driver allows LEDs to be controlled by USB events. Enabling this
 	  trigger allows specifying list of USB ports that should turn on LED
 	  when some USB device gets connected.
+
+config USB_AUTOSUSPEND_DELAY
+	int "Default autosuspend delay"
+	depends on USB
+	default 2
+	help
+	  The default autosuspend delay in seconds.  Can be overridden
+	  with the usbcore.autosuspend command line or module parameter.
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 4ebfbd737905..52e749386c1c 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -65,8 +65,8 @@ int usb_disabled(void)
 EXPORT_SYMBOL_GPL(usb_disabled);
 
 #ifdef	CONFIG_PM
-static int usb_autosuspend_delay = 2;		/* Default delay value,
-						 * in seconds */
+/* Default delay value, in seconds */
+static int usb_autosuspend_delay = CONFIG_USB_AUTOSUSPEND_DELAY;
 module_param_named(autosuspend, usb_autosuspend_delay, int, 0644);
 MODULE_PARM_DESC(autosuspend, "default autosuspend delay");
 
-- 
2.20.1


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

* Re: [PATCH] usb: core: make default autosuspend delay configurable
  2019-03-01 14:26 [PATCH] usb: core: make default autosuspend delay configurable Mans Rullgard
@ 2019-03-01 16:23 ` Greg Kroah-Hartman
  2019-03-01 16:43   ` [PATCH v2] " Mans Rullgard
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-03-01 16:23 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-usb, linux-kernel

On Fri, Mar 01, 2019 at 02:26:46PM +0000, Mans Rullgard wrote:
> Make the default autosuspend delay configurable at build time.
> This is useful for systems that require a non-standard value as
> it avoids relying on the command line being properly set.
> 
> Signed-off-by: Mans Rullgard <mans@mansr.com>
> ---
>  drivers/usb/core/Kconfig | 8 ++++++++
>  drivers/usb/core/usb.c   | 4 ++--
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
> index 4d75d9a80001..38ed837538c4 100644
> --- a/drivers/usb/core/Kconfig
> +++ b/drivers/usb/core/Kconfig
> @@ -90,3 +90,11 @@ config USB_LEDS_TRIGGER_USBPORT
>  	  This driver allows LEDs to be controlled by USB events. Enabling this
>  	  trigger allows specifying list of USB ports that should turn on LED
>  	  when some USB device gets connected.
> +
> +config USB_AUTOSUSPEND_DELAY
> +	int "Default autosuspend delay"
> +	depends on USB
> +	default 2
> +	help
> +	  The default autosuspend delay in seconds.  Can be overridden
> +	  with the usbcore.autosuspend command line or module parameter.

As everyone is suddenly going to be hit with this for a new kernel
upate, you might want to put something in here that says:
	The default value Linux has always had is 2 seconds.  Change
	this value if you want a different delay timeframe and can not
	modify the command line or module parameter option.

to make people a lot more comfortable with this change.

thanks,

greg k-h

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

* [PATCH v2] usb: core: make default autosuspend delay configurable
  2019-03-01 16:23 ` Greg Kroah-Hartman
@ 2019-03-01 16:43   ` Mans Rullgard
  2019-03-01 17:04     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Mans Rullgard @ 2019-03-01 16:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

Make the default autosuspend delay configurable at build time.
This is useful for systems that require a non-standard value as
it avoids relying on the command line being properly set.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
Changes in v2:
- add explanatory text to Kconfig help
---
 drivers/usb/core/Kconfig | 12 ++++++++++++
 drivers/usb/core/usb.c   |  4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 4d75d9a80001..cd91006e3f84 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -90,3 +90,15 @@ config USB_LEDS_TRIGGER_USBPORT
 	  This driver allows LEDs to be controlled by USB events. Enabling this
 	  trigger allows specifying list of USB ports that should turn on LED
 	  when some USB device gets connected.
+
+config USB_AUTOSUSPEND_DELAY
+	int "Default autosuspend delay"
+	depends on USB
+	default 2
+	help
+	  The default autosuspend delay in seconds.  Can be overridden
+	  with the usbcore.autosuspend command line or module parameter.
+
+	  The default value Linux has always had is 2 seconds.  Change
+	  this value if you want a different delay and cannot modify
+	  the command line or module parameter.
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 4ebfbd737905..52e749386c1c 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -65,8 +65,8 @@ int usb_disabled(void)
 EXPORT_SYMBOL_GPL(usb_disabled);
 
 #ifdef	CONFIG_PM
-static int usb_autosuspend_delay = 2;		/* Default delay value,
-						 * in seconds */
+/* Default delay value, in seconds */
+static int usb_autosuspend_delay = CONFIG_USB_AUTOSUSPEND_DELAY;
 module_param_named(autosuspend, usb_autosuspend_delay, int, 0644);
 MODULE_PARM_DESC(autosuspend, "default autosuspend delay");
 
-- 
2.20.1


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

* Re: [PATCH v2] usb: core: make default autosuspend delay configurable
  2019-03-01 16:43   ` [PATCH v2] " Mans Rullgard
@ 2019-03-01 17:04     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-03-01 17:04 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-usb, linux-kernel

On Fri, Mar 01, 2019 at 04:43:20PM +0000, Mans Rullgard wrote:
> Make the default autosuspend delay configurable at build time.
> This is useful for systems that require a non-standard value as
> it avoids relying on the command line being properly set.
> 
> Signed-off-by: Mans Rullgard <mans@mansr.com>
> ---
> Changes in v2:
> - add explanatory text to Kconfig help

Much nicer, thanks!

greg k-h

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

end of thread, other threads:[~2019-03-01 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 14:26 [PATCH] usb: core: make default autosuspend delay configurable Mans Rullgard
2019-03-01 16:23 ` Greg Kroah-Hartman
2019-03-01 16:43   ` [PATCH v2] " Mans Rullgard
2019-03-01 17:04     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).