]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: pnv_php: Fix surprise plug detection and recovery
authorTimothy Pearson <tpearson@raptorengineering.com>
Tue, 15 Jul 2025 21:39:06 +0000 (16:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:09:01 +0000 (12:09 +0200)
commit6e7b24c71e530a6c1d656e73d8a30ee081656844
tree325f2832d6237e9c001ba659b413e7d5883dbb80
parenta426e8a6ae161f51888585b065db0f8f93ab2e16
PCI: pnv_php: Fix surprise plug detection and recovery

[ Upstream commit a2a2a6fc2469524caa713036297c542746d148dc ]

The existing PowerNV hotplug code did not handle surprise plug events
correctly, leading to a complete failure of the hotplug system after device
removal and a required reboot to detect new devices.

This comes down to two issues:

 1) When a device is surprise removed, often the bridge upstream
    port will cause a PE freeze on the PHB.  If this freeze is not
    cleared, the MSI interrupts from the bridge hotplug notification
    logic will not be received by the kernel, stalling all plug events
    on all slots associated with the PE.

 2) When a device is removed from a slot, regardless of surprise or
    programmatic removal, the associated PHB/PE ls left frozen.
    If this freeze is not cleared via a fundamental reset, skiboot
    is unable to clear the freeze and cannot retrain / rescan the
    slot.  This also requires a reboot to clear the freeze and redetect
    the device in the slot.

Issue the appropriate unfreeze and rescan commands on hotplug events,
and don't oops on hotplug if pci_bus_to_OF_node() returns NULL.

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
[bhelgaas: tidy comments]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/171044224.1359864.1752615546988.JavaMail.zimbra@raptorengineeringinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/pci-hotplug.c
drivers/pci/hotplug/pnv_php.c