linux/arch/powerpc/platforms
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
..
4xx powerpc: Fix all occurences of duplicate words 2022-07-25 12:05:15 +10:00
8xx powerpc/8xx: Add missing of_node_put() in tqm8xx_setup.c 2022-09-05 17:28:25 +10:00
40x powerpc: Remove asm/prom.h from all files that don't need it 2022-05-08 22:15:04 +10:00
44x powerpc/44x: select I2C for CURRITUCK 2024-01-25 15:27:19 -08:00
52xx powerpc/52xx: Fix a resource leak in an error handling path 2022-12-31 13:32:50 +01:00
82xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
83xx powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe() 2022-12-31 13:32:51 +01:00
85xx powerpc: Cleanup idle for e500 2022-09-26 23:00:14 +10:00
86xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
512x powerpc/mpc512x: fix resource printk format warning 2023-05-11 23:03:31 +09:00
amigaone powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
book3s powerpc/vas: Return -EINVAL if the offset is non-zero in mmap() 2025-06-27 11:07:22 +01:00
cell spufs: fix a leak in spufs_create_context() 2025-04-10 14:33:40 +02:00
chrp powerpc: remove unused chrp_event_scan() declaration 2022-09-15 22:55:45 +10:00
embedded6xx powerpc/embedded6xx: Fix no previous prototype for avr_uart_send() etc. 2024-03-26 18:20:52 -04:00
maple powerpc/maple: Add missing of_node_put() in time.c 2022-09-05 17:28:25 +10:00
microwatt random: remove CONFIG_ARCH_RANDOM 2022-07-18 15:03:37 +02:00
pasemi powerpc/pasemi: Use of_root in pas_pci_init() 2022-09-06 11:03:31 +10:00
powermac powerpc/powermac: Use early_* IO variants in via_calibrate_decr() 2023-09-13 09:42:24 +02:00
powernv powerpc/powernv/memtrace: Fix out of bounds issue in memtrace mmap 2025-06-27 11:07:22 +01:00
ps3 powerpc: Remove remaining parts of oprofile 2022-07-27 21:36:05 +10:00
pseries powerpc/pseries/msi: Avoid reading PCI device registers in reduced power states 2025-06-27 11:07:26 +01:00
fsl_uli1575.c powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
Kconfig powerpc: Rename PPC_NATIVE to PPC_HASH_MMU_NATIVE 2021-12-02 22:57:22 +11:00
Kconfig.cputype powerpc/64: Add support to build with prefixed instructions 2024-10-17 15:21:24 +02:00
Makefile powerpc: Add Microwatt platform 2021-06-21 21:15:26 +10:00