linux/arch/powerpc
Gautam Menghani 26776ac0c1 powerpc/pseries/msi: Avoid reading PCI device registers in reduced power states
commit 9cc0eafd28 upstream.

When a system is being suspended to RAM, the PCI devices are also
suspended and the PPC code ends up calling pseries_msi_compose_msg() and
this triggers the BUG_ON() in __pci_read_msi_msg() because the device at
this point is in reduced power state. In reduced power state, the memory
mapped registers of the PCI device are not accessible.

To replicate the bug:
1. Make sure deep sleep is selected
	# cat /sys/power/mem_sleep
	s2idle [deep]

2. Make sure console is not suspended (so that dmesg logs are visible)
	echo N > /sys/module/printk/parameters/console_suspend

3. Suspend the system
	echo mem > /sys/power/state

To fix this behaviour, read the cached msi message of the device when the
device is not in PCI_D0 power state instead of touching the hardware.

Fixes: a5f3d2c17b ("powerpc/pseries/pci: Add MSI domains")
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250305090237.294633-1-gautam@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-06-27 11:07:26 +01:00
..
boot powerpc/boot: Only free if realloc() succeeds 2024-08-29 17:30:37 +02:00
configs arch/powerpc: drop GENERIC_PTDUMP from mpc885_ads_defconfig 2025-04-10 14:33:36 +02:00
crypto treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
include powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline 2025-03-07 16:56:34 +01:00
kernel powerpc/prom_init: Fixup missing #size-cells on PowerBook6,7 2025-06-04 14:40:08 +02:00
kexec powerpc/crash: Fix non-smp kexec preparation 2025-06-27 11:07:06 +01:00
kvm Revert "KVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map()" 2025-03-13 12:53:24 +01:00
lib powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC 2025-03-07 16:56:34 +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 arch/powerpc/perf: Check the instruction type before creating sample with perf_mem_data_src 2025-06-04 14:40:15 +02:00
platforms powerpc/pseries/msi: Avoid reading PCI device registers in reduced power states 2025-06-27 11:07:26 +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