powerpc/eeh: Make EEH driver device hotplug safe
authorTimothy Pearson <tpearson@raptorengineering.com>
Tue, 15 Jul 2025 21:38:23 +0000 (16:38 -0500)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Sat, 26 Jul 2025 07:39:10 +0000 (13:09 +0530)
commit1010b4c012b0d78dfb9d3132b49aa2ef024a07a7
treef67fcaebc1c32a665c7bb96d1523908ef6a845db
parente82b34eed04b0ddcff4548b62633467235672fd3
powerpc/eeh: Make EEH driver device hotplug safe

Multiple race conditions existed between the PCIe hotplug driver and the
EEH driver, leading to a variety of kernel oopses of the same general
nature:

<pcie device unplug>
<eeh driver trigger>
<hotplug removal trigger>
<pcie tree reconfiguration>
<eeh recovery next step>
<oops in EEH driver bus iteration loop>

A second class of oops is also seen when the underlying bus disappears
during device recovery.

Refactor the EEH module to be PCI rescan and remove safe.  Also clean
up a few minor formatting / readability issues.

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/1334208367.1359861.1752615503144.JavaMail.zimbra@raptorengineeringinc.com
arch/powerpc/kernel/eeh_driver.c
arch/powerpc/kernel/eeh_pe.c