linux/arch/powerpc/kernel
Shivaprasad G Bhat 8a4978c17a powerpc/rtas_pci: No hotplug on permanently removed device on pSeries
The eeh_driver disables and offlines the PE permanently when it
exceeds the freeze count beyond eeh_max_freeze within the last hour.
The PE is only offline, so the device tree entries, eeh device
references are all intact till the real unplug of the device from
the guest/host takes place.

On pSeries, with a new hotplug of any PCI device, the drmgr initiates
a system-wide PCI rescan, which finds devices offlined by the eeh_driver
and there will be attempts to bring them online. This leads to
recurring EEHs either at the config read time itself or a bit
later depending on the type of the problem.

For PowerNV, the commit d2b0f6f77e ("powerpc/eeh: No hotplug on
permanently removed dev") introduced the EEH_DEV_REMOVED flag to
prevent such inadvertent rescans on hierarchical toplogies relavent in
Baremetal setups. For pSeries, such topologies don't really make sense
as the devices are either part of the same PE OR exposed as independent
devices on multiple virtual PHBs. However, the inadvertent rescans are
still a possibility with either hotplug of a new device or otherwise
with manual system-wide pci bus rescan attempts.

So the patch checks for EEH_DEV_REMOVED before allowing config space
access just like PowerNV, making the PCI core omit the PE, and thus
preventing subsequent EEH recurances. The patch is tested on PowerVM
and KVM machines with single and multi-function devices, and on the
devices behind a switch. The unplug of the affected devices post EEH
removal is also working fine as expected.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reported-by: Tasmiya Nalatwad <tasmiya@linux.ibm.com>
Tested-by: Tasmiya Nalatwad <tasmiya@linux.ibm.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
References: d2b0f6f77e ("powerpc/eeh: No hotplug on permanently removed dev")
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/178246517230.1267.12206176311111155505.stgit@linux.ibm.com
2026-09-05 11:11:39 +05:30
..
ptrace powerpc: Fix exit_flags field placement in pt_regs for ptrace 2026-07-28 10:23:31 +05:30
syscalls arch: hookup fchroot() system call 2026-07-27 17:18:00 +02:00
trace powerpc64/ftrace: workaround clang recording GEP in __patchable_function_entries 2026-03-07 16:02:25 +05:30
vdso powerpc/vdso: Respect COMPAT_32BIT_TIME 2026-07-07 23:52:53 +02:00
.gitignore
85xx_entry_mapping.S
align.c powerpc/align: Convert emulate_spe() to scoped user access 2026-04-01 09:21:07 +05:30
asm-offsets.c powerpc/32s: Fix segments setup when TASK_SIZE is not a multiple of 256M 2026-01-07 09:31:04 +05:30
audit_32.h powerpc: address missing-prototypes warnings 2023-08-02 22:22:19 +10:00
btext.c kernel.h: drop hex.h and update all hex.h users 2026-01-20 19:44:19 -08:00
cacheinfo.c powerpc: Use sysfs_emit() for cpumask show callbacks 2026-07-22 15:38:37 -04:00
cacheinfo.h
cpu_setup_6xx.S powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX 2024-05-08 00:25:00 +10:00
cpu_setup_44x.S
cpu_setup_e500.S powerpc/32: Fix objtool unannotated intra-function call warnings 2022-11-18 19:00:06 +11:00
cpu_setup_pa6t.S
cpu_setup_power.c powerpc: Add Power12 raw mode 2026-08-06 11:00:55 +05:30
cpu_setup_ppc970.S
cpu_specs_8xx.h
cpu_specs_44x.h
cpu_specs_47x.h
cpu_specs_85xx.h
cpu_specs_book3s_32.h
cpu_specs_book3s_64.h powerpc: Add Power12 architected mode 2026-08-06 11:00:55 +05:30
cpu_specs_e500mc.h powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E 2024-02-14 14:24:06 +11:00
cpu_specs.h powerpc: Remove core support for 40x 2024-06-28 22:28:47 +10:00
cputable.c powerpc: Make cpu_spec __ro_after_init 2023-11-27 22:01:14 +11:00
crash_dump.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
dawr.c
dbell.c powerpc/64: Fix perf profiling asynchronous interrupt handlers 2023-01-30 20:07:42 +11:00
dexcr.c powerpc/dexcr: Add DEXCR prctl interface 2024-05-06 22:04:31 +10:00
dma-iommu.c driver core: Replace dev->dma_ops_bypass with dev_dma_ops_bypass() 2026-04-26 23:43:05 +02:00
dma-mask.c dma-mapping: move arch_dma_set_mask() declaration to header 2023-07-31 17:54:28 +02:00
dma-swiotlb.c
dt_cpu_ftrs.c powerpc: Add Power12 raw mode 2026-08-06 11:00:55 +05:30
early_32.c
eeh_cache.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
eeh_driver.c powerpc/eeh: Fix recursive locking on devices without EEH sensitive driver 2026-09-05 11:11:39 +05:30
eeh_event.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
eeh_pe.c powerpc/eeh: fix recursive pci_lock_rescan_remove locking in EEH event handling 2026-01-08 17:56:53 +05:30
eeh_sysfs.c powerpc: use sysfs_emit{_at} in sysfs show functions 2026-06-02 11:24:32 +05:30
eeh.c powerpc/eeh: Export eeh_unfreeze_pe() 2025-07-26 13:07:52 +05:30
entry_32.S powerpc/32: Restore disabling of interrupts at interrupt/syscall exit 2025-12-22 18:25:07 +05:30
epapr_hcalls.S powerpc/4xx: Remove CONFIG_BOOKE_OR_40x 2024-06-28 22:28:48 +10:00
epapr_paravirt.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
exceptions-64e.S powerpc/64e: drop unused TLB miss handlers 2024-07-12 15:52:15 -07:00
exceptions-64s.S powerpc/cell: Remove support for IBM Cell Blades 2025-02-26 21:15:07 +05:30
fadump.c powerpc/fadump: define MIN_RMA in bytes rather than MB 2026-06-16 15:08:25 +05:30
firmware.c powerpc: Export kvm_guest static key, for bcachefs six locks 2024-01-01 11:47:38 -05:00
fpu.S powerpc: Don't clobber f0/vs0 during fp|altivec register save 2023-11-28 23:04:43 +11:00
head_8xx.S powerpc/8xx: Remove left-over instruction and comments in DataStoreTLBMiss handler 2025-09-15 13:48:22 +05:30
head_32.h powerpc: Remove core support for 40x 2024-06-28 22:28:47 +10:00
head_44x.S powerpc/44x: Introduce _PAGE_READ and remove _PAGE_USER 2023-10-19 17:12:46 +11:00
head_64.S powerpc/64s: Clarify copy_and_flush() cache sync loop comment 2026-08-03 14:49:17 +05:30
head_85xx.S powerpc/e500: Always use 64 bits PTE 2026-03-04 11:05:06 +05:30
head_book3s_32.S powerpc/32s: Fix segments setup when TASK_SIZE is not a multiple of 256M 2026-01-07 09:31:04 +05:30
head_booke.h powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-09-01 13:23:29 +05:30
hw_breakpoint_constraints.c powerpc/watchpoint: Disable pagefaults when getting user instruction 2023-09-18 12:23:47 +10:00
hw_breakpoint.c powerpc/watchpoints: Annotate atomic context in more places 2023-09-18 12:23:47 +10:00
idle_6xx.S
idle_64e.S
idle_85xx.S
idle_book3s.S
idle.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ima_arch.c powerpc/ima: Drop unnecessary check for CONFIG_MODULE_SIG 2026-03-08 08:26:08 -04:00
interrupt_64.S powerpc/64: Set task pt_regs->link to the LR value on scv entry 2024-02-05 22:43:19 +11:00
interrupt.c powerpc: Don't drop _TIF_RESTOREALL on syscall restart 2026-09-03 15:09:20 +05:30
io.c powerpc/io: Use standard barrier macros in io.c 2025-02-26 21:15:09 +05:30
iomap.c
iommu.c powerpc: use sysfs_emit{_at} in sysfs show functions 2026-06-02 11:24:32 +05:30
irq_64.c work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
irq.c powerpc/irq: Fix missing r2 clobber in PCREL inline assembly 2026-08-03 14:12:47 +05:30
isa-bridge.c mm: Introduce vmap_page_range() to map pages in PCI address space 2024-03-11 16:58:10 +01:00
jump_label.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kdebugfs.c
kgdb.c powerpc: kgdb: fix kernel-doc warnings 2026-04-01 09:21:06 +05:30
kprobes-ftrace.c kprobe/ftrace: bail out if ftrace was killed 2024-05-16 07:23:30 +09:00
kprobes.c powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
kvm_emul.S
kvm.c powerpc/kvm: Fix ifdef to remove build warning 2025-08-20 14:03:44 +05:30
l2cr_6xx.S
legacy_serial.c serial: 8250: sanitize uart_port::serial_{in,out}() types 2025-06-17 13:42:34 +02:00
Makefile powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC 2026-04-01 09:21:06 +05:30
mce_power.c
mce.c powerpc/mce: log the error for all unrecoverable errors 2023-02-10 22:17:34 +11:00
misc_32.S powerpc/32: Replace mulhdu() by mul_u64_u64_shr() 2024-12-10 08:15:30 +05:30
misc_64.S powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
misc.S powerpc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-16 23:54:48 +10:00
module_32.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
module_64.c powerpc64/modules: replace stub allocation sentinel with an explicit counter 2025-09-15 16:40:52 +05:30
module.c powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
msi.c
note.S
nvram_64.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
optprobes_head.S powerpc: add definition for pt_regs offset within an interrupt frame 2022-12-02 17:54:08 +11:00
optprobes.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
paca.c docs: move powerpc under arch 2023-10-10 13:35:55 -06:00
pci_32.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
pci_64.c powerpc/pci_64: Init pcibios subsys a bit later 2023-03-14 23:36:27 +11:00
pci_dn.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci_of_scan.c powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices 2026-03-03 10:29:15 -06:00
pci-common.c PCI/sysfs: Fix out-of-bounds read in pci_write_legacy_io() 2026-07-06 18:01:09 +00:00
pci-hotplug.c PCI: pnv_php: Fix surprise plug detection and recovery 2025-07-26 13:09:15 +05:30
pmc.c powerpc/85xx: Mark some functions static and add missing includes to fix no previous prototype error 2023-08-23 15:55:21 +10:00
ppc_save_regs.S powerpc: update ppc_save_regs to save current r1 in pt_regs 2023-06-19 17:37:14 +10:00
proc_powerpc.c powerpc: Replace strcpy() with strscpy() in proc_ppc64_init() 2025-05-15 09:54:54 +05:30
process.c powerpc/64s: do not re-activate batched TLB flush 2026-01-20 19:24:32 -08:00
prom_entry_64.S powerpc/64: Rename entry_64.S to prom_entry_64.S 2023-06-15 14:04:19 +10:00
prom_init_check.sh powerpc/prom_init: Fix shellcheck warnings 2025-08-20 14:05:18 +05:30
prom_init.c powerpc: Add Power12 architected mode 2026-08-06 11:00:55 +05:30
prom_parse.c
prom.c powerpc/crash: use generic crashkernel reservation 2025-03-16 22:30:48 -07:00
reloc_32.S
reloc_64.S
rethook.c powerpc: Replace kretprobe code with rethook on powerpc 2024-09-05 22:25:36 +10:00
rtas_entry.S
rtas_flash.c powerpc: rtas: use get_user to simplify manage_flash_write 2026-07-31 17:01:19 +05:30
rtas_pci.c powerpc/rtas_pci: No hotplug on permanently removed device on pSeries 2026-09-05 11:11:39 +05:30
rtas-proc.c powerpc/rtas: Fix ppc_rtas_rmo_buf_show() kernel-doc 2023-11-07 13:13:45 +11:00
rtas-rtc.c powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
rtas.c powerpc/pseries: Define HVPIPE specific macros 2025-09-15 13:38:40 +05:30
rtasd.c powerpc/rtasd: Use struct_size() to simplify log_rtas_len() 2026-07-31 17:02:07 +05:30
secure_boot.c integrity: Make arch_ima_get_secureboot integrity-wide 2026-03-05 11:10:08 -05:00
security.c powerpc: use sysfs_emit{_at} in sysfs show functions 2026-06-02 11:24:32 +05:30
secvar-ops.c powerpc/secvar: Warn and error if multiple secvar ops are set 2023-02-12 22:12:36 +11:00
secvar-sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
setup_32.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
setup_64.c powerpc/64: Drop unnecessary 'rc' variable 2025-08-20 13:54:05 +05:30
setup-common.c powerpc: Add Power12 raw mode 2026-08-06 11:00:55 +05:30
setup.h powerpc/4xx: Remove CONFIG_BOOKE_OR_40x 2024-06-28 22:28:48 +10:00
signal_32.c powerpc/signal32: Force inlining of __unsafe_save_user_regs() and save_tm_user_regs_unsafe() 2023-06-09 23:29:51 +10:00
signal_64.c
signal.c powerpc: Fix exit_flags field placement in pt_regs for ptrace 2026-07-28 10:23:31 +05:30
signal.h powerpc: Replace GPL 2.0+ README.legal boilerplate with SPDX 2023-09-19 20:05:58 +10:00
smp-tbsync.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smp.c powerpc/smp: add NULL guard for cause_ipi in smp_muxed_ipi_message_pass 2026-08-03 13:56:00 +05:30
stacktrace.c powerpc: Replace kretprobe code with rethook on powerpc 2024-09-05 22:25:36 +10:00
static_call.c powerpc/static_call: Implement inline static calls 2025-02-26 21:09:43 +05:30
suspend.c
switch.S powerpc: Fix 'intra_function_call not a direct call' warning 2025-03-10 10:00:17 +05:30
swsusp_32.S powerpc/32: Fix objtool unannotated intra-function call warnings 2022-11-18 19:00:06 +11:00
swsusp_64.c powerpc/suspend: Add prototype for do_after_copyback() 2023-11-30 13:15:49 +11:00
swsusp_85xx.S
swsusp_asm64.S
swsusp.c
sys_ppc32.c fs: fix archiecture-specific compat_ftruncate64 2026-03-23 12:41:57 +01:00
syscall.c powerpc/entry: Clear TIF_SYSCALL_RET before syscall error return 2026-09-03 15:06:00 +05:30
syscalls.c
sysfs.c powerpc: use sysfs_emit{_at} in sysfs show functions 2026-06-02 11:24:32 +05:30
systbl.c
tau_6xx.c powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues 2023-05-08 13:52:27 -10:00
time.c powerpc/vtime: Initialize starttime at boot for native accounting 2026-07-15 08:04:13 +05:30
tm.S powerpc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-16 23:54:48 +10:00
traps.c powerpc: rename arch_irq_disabled_regs 2026-05-20 06:57:13 +05:30
ucall.S powerpc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-16 23:54:48 +10:00
udbg_16550.c powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
udbg.c powerpc: Remove UDBG_RTAS_CONSOLE 2025-02-26 21:15:09 +05:30
uprobes.c
vdso.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vdso32_wrapper.S powerpc/vdso: Mark the vDSO code read-only after init 2024-12-18 13:46:38 +05:30
vdso64_wrapper.S powerpc/vdso: Mark the vDSO code read-only after init 2024-12-18 13:46:38 +05:30
vecemu.c
vector.S powerpc: Don't clobber f0/vs0 during fp|altivec register save 2023-11-28 23:04:43 +11:00
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
watchdog.c powerpc: rename arch_irq_disabled_regs 2026-05-20 06:57:13 +05:30