usb: core: make default autosuspend delay configurable
PATCH 1/1 usb: core: make default autosuspend delay configurable
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.
--- drivers/usb/core/Kconfig | 8 ++++++++ drivers/usb/core/usb.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/usb/core/Kconfig +8 -0
@@ -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.
drivers/usb/core/usb.c +2 -2
@@ -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" );
Greg Kroah-Hartman
maintainerQuoted 16 lines · Mans Rullgard
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 <[email protected]>--- drivers/usb/core/Kconfig | 8 ++++++++ drivers/usb/core/usb.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-)drivers/usb/core/Kconfig +0
-0@@ -90,3 +90,11 @@ config USB_LEDS_TRIGGER_USBPORT This driver allows LEDs to be controlled by USB events. Enabling this
drivers/usb/core/Kconfig config USB_LEDS_TRIGGER_USBPORT · line 100
Quoted 10 lines
drivers/usb/core/Kconfig +8
-0trigger 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
PATCH v2 1/1 usb: core: make default autosuspend delay configurable
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.
---
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(-)
drivers/usb/core/Kconfig +12 -0
@@ -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.
drivers/usb/core/usb.c +2 -2
@@ -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" );
Greg Kroah-Hartman
maintainerQuoted 8 lines · Mans Rullgard
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 <[email protected]>---
Changes in v2:
- add explanatory text toKconfighelp
Much nicer, thanks!
greg k-h