linux/arch/powerpc
Narayana Murty N 3a43f1d99b 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-21 13:49:44 +01:00
..
boot powerpc/boot: Only free if realloc() succeeds 2024-08-29 17:30:37 +02:00
configs powerpc/configs: Update defconfig with now user-visible CONFIG_FSL_IFC 2024-08-03 08:48:52 +02:00
crypto treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
include powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active 2025-02-21 13:48:52 +01:00
kernel powerpc/prom_init: Fixup missing powermac #size-cells 2024-12-14 19:54:49 +01:00
kexec powerpc/kexec: Fix return of uninitialized variable 2024-12-14 19:53:42 +01:00
kvm KVM: e500: always restore irqs 2025-02-21 13:49:34 +01:00
lib powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static 2024-12-14 19:53:42 +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-14 19:53:37 +01:00
net powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH 2024-06-16 13:41:42 +02:00
perf powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks 2024-03-26 18:20:52 -04:00
platforms powerpc/pseries/eeh: Fix get PE state translation 2025-02-21 13:49:44 +01:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-21 16:00:55 +02:00
sysdev powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu 2024-08-29 17:30:33 +02:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc/xmon: Fix disassembly CPU feature checks 2024-08-03 08:49:22 +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-14 19:54:17 +01:00
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-19 16:22:04 +02:00
Makefile powerpc: Adjust adding stack protector flags to KBUILD_CLAGS for clang 2024-12-14 19:54:17 +01:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00