linux/arch/powerpc
Gautam Menghani 0b42b68cec 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:11:14 +01:00
..
boot powerpc/boot: Fix dash warning 2025-05-09 09:50:37 +02:00
configs arch/powerpc: drop GENERIC_PTDUMP from mpc885_ads_defconfig 2025-04-10 14:39:24 +02:00
crypto crypto: lib/Kconfig - Hide arch options from user 2025-05-02 07:59:32 +02:00
include powerpc/pseries/iommu: memory notifier incorrectly adds TCEs for pmemory 2025-05-29 11:02:57 +02:00
kernel powerpc: do not build ppc_save_regs.o always 2025-06-19 15:31:27 +02:00
kexec powerpc/crash: Fix non-smp kexec preparation 2025-06-19 15:31:27 +02:00
kvm KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests 2025-04-20 10:15:54 +02:00
lib powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC 2025-02-27 04:30:16 -08:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm book3s64/radix: Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n 2025-05-29 11:03:09 +02:00
net powerpc updates for 6.11 2024-07-19 21:00:33 -07:00
perf arch/powerpc/perf: Check the instruction type before creating sample with perf_mem_data_src 2025-05-29 11:02:57 +02:00
platforms powerpc/pseries/msi: Avoid reading PCI device registers in reduced power states 2025-06-27 11:11:14 +01:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc: Switch back to struct platform_driver::remove() 2024-09-10 11:27:40 +10:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon powerpc/xmon: Fix tmpstr length check in scanhex 2024-08-27 17:10:55 +10:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc: Fix stack protector Kconfig test for clang 2024-12-09 10:41:10 +01:00
Kconfig.debug powerpc/64s: Remove the "fast endian switch" syscall 2024-09-05 22:30:05 +10:00
Makefile powerpc: Adjust adding stack protector flags to KBUILD_CLAGS for clang 2024-12-09 10:41:10 +01:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00