reboot: Add timeout for device shutdown
PATCH 1/1 reboot: Add timeout for device shutdown
The device shutdown callbacks invoked during shutdown/reboot are prone to errors depending on the device state or mishandling by one or more driver. In order to prevent a device hang in such scenarios, we bail out after a timeout while dumping a meaningful call trace of the shutdown callback which blocks the shutdown or reboot process.
--- drivers/base/Kconfig | 15 +++++++++++++++ kernel/reboot.c | 46 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-)
drivers/base/Kconfig +15 -0
@@ -243,3 +243,18 @@ config FW_DEVLINK_SYNC_STATE_TIMEOUT work on. endmenu + +config DEVICE_SHUTDOWN_TIMEOUT + bool "device shutdown timeout" + default n + help + Enable timeout for device shutdown. Helps in case device shutdown + is hung during shoutdonw and reboot. + + +config DEVICE_SHUTDOWN_TIMEOUT_SEC + int "device shutdown timeout in seconds" + default 5 + depends on DEVICE_SHUTDOWN_TIMEOUT + help + sets time for device shutdown timeout in seconds
kernel/reboot.c +45 -1
77 lines not on this page · raw message
Signature · 1 line
2.40.0
Greg KH
maintainerQuoted 8 lines · Soumya Khasnis
The device shutdown callbacks invoked during shutdown/reboot are prone to errors depending on the device state or mishandling by one or more driver. In order to prevent a device hang in such scenarios, we bail out after a timeout while dumping a meaningful call trace of the shutdown callback which blocks the shutdown or reboot process.
Change-Id: Ibfc63ca8f8aa45866cbe6b90401d438d95eca742
Any reason you didn't run this through checkpatch.pl first?
:(