summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2026-04-21 18:06:44 +0300
committerBjorn Helgaas <bhelgaas@google.com>2026-04-28 01:26:59 +0300
commitcfcbfe5cb11650d53f7cafd7adfd556690b77114 (patch)
tree3ddc6ed42aca3aaafebe06e1cfff3bfc355e45eb
parent254f49634ee16a731174d2ae34bc50bd5f45e731 (diff)
downloadlinux-cfcbfe5cb11650d53f7cafd7adfd556690b77114.tar.xz
PCI: Don't fallback to bus reset after failed slot reset
If a bus has hotplug slots that implement the slot's reset_slot callback, it is not safe to do the non-slot specific bus reset, so don't fallback to it. If a slot reset does fail, the subsequent bus reset will attempt a 2nd link reset on top of previous and fail to handle the hotplug events. Fixes: 8238cb69c01fe ("PCI: Make reset_subordinate hotplug safe") Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260421150644.3543733-1-kbusch@meta.com
-rw-r--r--drivers/pci/pci.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 8f7cfcc00090..d34266651ad0 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5607,13 +5607,14 @@ static int pci_try_reset_bus(struct pci_bus *bus)
* reset for affected devices
*
* This function will first try to reset the slots on this bus if the method is
- * available. If slot reset fails or is not available, this will fall back to a
+ * available. If slot reset is not available, this will fall back to a
* secondary bus reset.
*/
static int pci_reset_bridge(struct pci_dev *bridge, bool restore)
{
struct pci_bus *bus = bridge->subordinate;
struct pci_slot *slot;
+ int ret = 0;
if (!bus)
return -ENOTTY;
@@ -5627,19 +5628,17 @@ static int pci_reset_bridge(struct pci_dev *bridge, bool restore)
goto bus_reset;
list_for_each_entry(slot, &bus->slots, list) {
- int ret;
-
if (restore)
ret = pci_try_reset_slot(slot);
else
ret = pci_slot_reset(slot, PCI_RESET_DO_RESET);
if (ret)
- goto bus_reset;
+ break;
}
mutex_unlock(&pci_slot_mutex);
- return 0;
+ return ret;
bus_reset:
mutex_unlock(&pci_slot_mutex);