linux/arch/powerpc
Narayana Murty N 4a39092680 powerpc/pseries/eeh: Fix get PE state translation
commit 11b9355900 upstream.

The PE Reset State "0" returned by RTAS calls
"ibm_read_slot_reset_[state|state2]" indicates that the reset is
deactivated and the PE is in a state where MMIO and DMA are allowed.
However, the current implementation of "pseries_eeh_get_state()" does
not reflect this, causing drivers to incorrectly assume that MMIO and
DMA operations cannot be resumed.

The userspace drivers as a part of EEH recovery using VFIO ioctls fail
to detect when the recovery process is complete. The VFIO_EEH_PE_GET_STATE
ioctl does not report the expected EEH_PE_STATE_NORMAL state, preventing
userspace drivers from functioning properly on pseries systems.

The patch addresses this issue by updating 'pseries_eeh_get_state()'
to include "EEH_STATE_MMIO_ENABLED" and "EEH_STATE_DMA_ENABLED" in
the result mask for PE Reset State "0". This ensures correct state
reporting to the callers, aligning the behavior with the PAPR specification
and fixing the bug in EEH recovery for VFIO user workflows.

Fixes: 00ba05a12b ("powerpc/pseries: Cleanup on pseries_eeh_get_state()")
Cc: stable@vger.kernel.org
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
Link: https://lore.kernel.org/stable/20241212075044.10563-1-nnmlinux%40linux.ibm.com
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250116103954.17324-1-nnmlinux@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-02-17 09:40:24 +01:00
..
boot powerpc/boot: Only free if realloc() succeeds 2024-08-29 17:33:36 +02:00
configs Revert "powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2" 2024-10-17 15:24:10 +02:00
crypto crypto: powerpc/p10-aes-gcm - Disable CRYPTO_AES_GCM_P10 2024-10-04 16:29:35 +02:00
include powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active 2025-02-08 09:51:41 +01:00
kernel sched/topology: Rename 'DIE' domain to 'PKG' 2025-02-08 09:51:44 +01:00
kexec powerpc/kexec: Fix return of uninitialized variable 2024-12-09 10:32:21 +01:00
kvm KVM: e500: always restore irqs 2025-02-17 09:40:11 +01:00
lib powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static 2024-12-09 10:32:21 +01:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/mm/fault: Fix kfence page fault reporting 2024-12-09 10:32:15 +01:00
net Revert "powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data" 2024-07-09 11:44:29 +02:00
perf powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks 2024-03-26 18:19:54 -04:00
platforms powerpc/pseries/eeh: Fix get PE state translation 2025-02-17 09:40:24 +01:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev of: remove internal arguments from of_property_for_each_u32() 2025-02-08 09:51:51 +01:00
tools powerpc/ftrace: Add support for -fpatchable-function-entry 2023-08-22 00:09:06 +10:00
xmon powerpc/xmon: Fix disassembly CPU feature checks 2024-08-03 08:54:02 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig powerpc: Fix stack protector Kconfig test for clang 2024-12-09 10:33:09 +01:00
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-03 16:07:55 +10:00
Makefile powerpc: Adjust adding stack protector flags to KBUILD_CLAGS for clang 2024-12-09 10:33:09 +01:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00