From: Greg Kroah-Hartman Date: Mon, 24 Aug 2020 07:47:55 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.4.234~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfcdd9a5dde690fea18caba59bd9534e4b0ac32b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: efi-add-missed-destroy_workqueue-when-efisubsys_init-fails.patch powerpc-pseries-do-not-initiate-shutdown-when-system-is-running-on-ups.patch --- diff --git a/queue-5.4/efi-add-missed-destroy_workqueue-when-efisubsys_init-fails.patch b/queue-5.4/efi-add-missed-destroy_workqueue-when-efisubsys_init-fails.patch new file mode 100644 index 00000000000..d7d3c443818 --- /dev/null +++ b/queue-5.4/efi-add-missed-destroy_workqueue-when-efisubsys_init-fails.patch @@ -0,0 +1,41 @@ +From 98086df8b70c06234a8f4290c46064e44dafa0ed Mon Sep 17 00:00:00 2001 +From: Li Heng +Date: Mon, 20 Jul 2020 15:22:18 +0800 +Subject: efi: add missed destroy_workqueue when efisubsys_init fails + +From: Li Heng + +commit 98086df8b70c06234a8f4290c46064e44dafa0ed upstream. + +destroy_workqueue() should be called to destroy efi_rts_wq +when efisubsys_init() init resources fails. + +Cc: +Reported-by: Hulk Robot +Signed-off-by: Li Heng +Link: https://lore.kernel.org/r/1595229738-10087-1-git-send-email-liheng40@huawei.com +Signed-off-by: Ard Biesheuvel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/efi/efi.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/firmware/efi/efi.c ++++ b/drivers/firmware/efi/efi.c +@@ -345,6 +345,7 @@ static int __init efisubsys_init(void) + efi_kobj = kobject_create_and_add("efi", firmware_kobj); + if (!efi_kobj) { + pr_err("efi: Firmware registration failed.\n"); ++ destroy_workqueue(efi_rts_wq); + return -ENOMEM; + } + +@@ -381,6 +382,7 @@ err_unregister: + generic_ops_unregister(); + err_put: + kobject_put(efi_kobj); ++ destroy_workqueue(efi_rts_wq); + return error; + } + diff --git a/queue-5.4/powerpc-pseries-do-not-initiate-shutdown-when-system-is-running-on-ups.patch b/queue-5.4/powerpc-pseries-do-not-initiate-shutdown-when-system-is-running-on-ups.patch new file mode 100644 index 00000000000..2757130e038 --- /dev/null +++ b/queue-5.4/powerpc-pseries-do-not-initiate-shutdown-when-system-is-running-on-ups.patch @@ -0,0 +1,66 @@ +From 90a9b102eddf6a3f987d15f4454e26a2532c1c98 Mon Sep 17 00:00:00 2001 +From: Vasant Hegde +Date: Thu, 20 Aug 2020 11:48:44 +0530 +Subject: powerpc/pseries: Do not initiate shutdown when system is running on UPS + +From: Vasant Hegde + +commit 90a9b102eddf6a3f987d15f4454e26a2532c1c98 upstream. + +As per PAPR we have to look for both EPOW sensor value and event +modifier to identify the type of event and take appropriate action. + +In LoPAPR v1.1 section 10.2.2 includes table 136 "EPOW Action Codes": + + SYSTEM_SHUTDOWN 3 + + The system must be shut down. An EPOW-aware OS logs the EPOW error + log information, then schedules the system to be shut down to begin + after an OS defined delay internal (default is 10 minutes.) + +Then in section 10.3.2.2.8 there is table 146 "Platform Event Log +Format, Version 6, EPOW Section", which includes the "EPOW Event +Modifier": + + For EPOW sensor value = 3 + 0x01 = Normal system shutdown with no additional delay + 0x02 = Loss of utility power, system is running on UPS/Battery + 0x03 = Loss of system critical functions, system should be shutdown + 0x04 = Ambient temperature too high + All other values = reserved + +We have a user space tool (rtas_errd) on LPAR to monitor for +EPOW_SHUTDOWN_ON_UPS. Once it gets an event it initiates shutdown +after predefined time. It also starts monitoring for any new EPOW +events. If it receives "Power restored" event before predefined time +it will cancel the shutdown. Otherwise after predefined time it will +shutdown the system. + +Commit 79872e35469b ("powerpc/pseries: All events of +EPOW_SYSTEM_SHUTDOWN must initiate shutdown") changed our handling of +the "on UPS/Battery" case, to immediately shutdown the system. This +breaks existing setups that rely on the userspace tool to delay +shutdown and let the system run on the UPS. + +Fixes: 79872e35469b ("powerpc/pseries: All events of EPOW_SYSTEM_SHUTDOWN must initiate shutdown") +Cc: stable@vger.kernel.org # v4.0+ +Signed-off-by: Vasant Hegde +[mpe: Massage change log and add PAPR references] +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200820061844.306460-1-hegdevasant@linux.vnet.ibm.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/pseries/ras.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/powerpc/platforms/pseries/ras.c ++++ b/arch/powerpc/platforms/pseries/ras.c +@@ -184,7 +184,6 @@ static void handle_system_shutdown(char + case EPOW_SHUTDOWN_ON_UPS: + pr_emerg("Loss of system power detected. System is running on" + " UPS/battery. Check RTAS error log for details\n"); +- orderly_poweroff(true); + break; + + case EPOW_SHUTDOWN_LOSS_OF_CRITICAL_FUNCTIONS: diff --git a/queue-5.4/series b/queue-5.4/series index 9e39a6dc010..b9829d3ab12 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -99,3 +99,5 @@ net-ena-prevent-reset-after-device-destruction.patch net-gemini-fix-missing-free_netdev-in-error-path-of-.patch hv_netvsc-fix-the-queue_mapping-in-netvsc_vf_xmit.patch net-dsa-b53-check-for-timeout.patch +powerpc-pseries-do-not-initiate-shutdown-when-system-is-running-on-ups.patch +efi-add-missed-destroy_workqueue-when-efisubsys_init-fails.patch