# git rev-parse -q --verify 90a9b102eddf6a3f987d15f4454e26a2532c1c98^{commit} 90a9b102eddf6a3f987d15f4454e26a2532c1c98 already have revision, skipping fetch # git checkout -q -f -B kisskb 90a9b102eddf6a3f987d15f4454e26a2532c1c98 # git clean -qxdf # < git log -1 # commit 90a9b102eddf6a3f987d15f4454e26a2532c1c98 # Author: Vasant Hegde # Date: Thu Aug 20 11:48:44 2020 +0530 # # 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 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 # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 90a9b102eddf6a3f987d15f4454e26a2532c1c98 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # Added to kconfig CONFIG_PPC_E500MC=y # Added to kconfig CONFIG_VIRTUALIZATION=y # Added to kconfig CONFIG_KVM_E500MC=y # Added to kconfig # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:4127:warning: override: reassigning to symbol PPC_E500MC .config:4128:warning: override: reassigning to symbol VIRTUALIZATION # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:12, from /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15: /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 22 | #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) | ^ /kisskb/src/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely' 78 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: note: in expansion of macro 'IS_ERR_VALUE' 139 | if (IS_ERR_VALUE(fep->ring_mem_addr)) | ^~~~~~~~~~~~ cc1: fatal error: opening output file arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory compilation terminated. make[2]: *** [scripts/Makefile.lib:326: arch/powerpc/boot/dts/fsl/mpc8540ads.dtb] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [arch/powerpc/Makefile:295: zImage] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:185: __sub-make] Error 2 Command 'make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 # Build took: 0:02:37.784365