linux-stable/arch/powerpc/platforms
Vasant Hegde 90a9b102ed powerpc/pseries: Do not initiate shutdown when system is running on UPS
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 79872e3546 ("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: 79872e3546 ("powerpc/pseries: All events of EPOW_SYSTEM_SHUTDOWN must initiate shutdown")
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[mpe: Massage change log and add PAPR references]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200820061844.306460-1-hegdevasant@linux.vnet.ibm.com
2020-08-20 22:55:54 +10:00
..
4xx powerpc/4xx: Don't unmap NULL mbase 2020-05-28 23:24:36 +10:00
8xx mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
40x powerpc: Remove IBM405 Erratum #77 2020-05-28 23:24:36 +10:00
44x powerpc/40x: Remove support for ISS Simulator 2020-05-28 23:24:35 +10:00
52xx powerpc updates for 5.9 2020-08-07 10:33:50 -07:00
82xx powerpc/82xx: Blacklist pq2_restart() for kprobe 2020-06-02 20:59:09 +10:00
83xx powerpc/83xx: Blacklist mpc83xx_deep_resume() for kprobe 2020-06-02 20:59:09 +10:00
85xx powerpc/Kconfig: Replace HTTP links with HTTPS ones 2020-07-16 13:12:46 +10:00
86xx mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
512x powerpc/512x: Use dma_request_chan() instead dma_request_slave_channel() 2020-01-06 16:25:29 +11:00
amigaone powerpc/32: drop unused ISA_DMA_THRESHOLD 2020-04-01 14:30:50 +11:00
cell powerpc updates for 5.9 2020-08-07 10:33:50 -07:00
chrp mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
embedded6xx powerpc/wii: Fix declaration made after definition 2020-05-20 23:39:56 +10:00
maple mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
pasemi powerpc: use for_each_child_of_node() macro 2020-07-29 22:30:33 +10:00
powermac Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
powernv powerpc/powernv/pci: Fix possible crash when releasing DMA resources 2020-08-20 12:30:40 +10:00
ps3 powerpc/ps3: Fix kexec shutdown hang 2020-05-19 00:10:35 +10:00
pseries powerpc/pseries: Do not initiate shutdown when system is running on UPS 2020-08-20 22:55:54 +10:00
fsl_uli1575.c
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Kconfig.cputype treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile