Skip to content

Commit

Permalink
IB/hfi1,PCI: Allow bus reset while probing
Browse files Browse the repository at this point in the history
Calling into the new API to reset the secondary bus results in a deadlock.
This occurs because the device/bus is already locked at probe time.
Reverting back to the old behavior while the API is improved.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=200985
Fixes: c6a44ba ("PCI: Rename pci_try_reset_bus() to pci_reset_bus()")
Fixes: 409888e ("IB/hfi1: Use pci_try_reset_bus() for initiating PCI Secondary Bus Reset")
Signed-off-by: Dennis Dalessandro <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Michael J. Ruhl <[email protected]>
Cc: Sinan Kaya <[email protected]>
  • Loading branch information
Dennis Dalessandro authored and bjorn-helgaas committed Sep 12, 2018
1 parent d8a5281 commit bfc4560
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/infiniband/hw/hfi1/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,14 +893,11 @@ static int trigger_sbr(struct hfi1_devdata *dd)
}

/*
* A secondary bus reset (SBR) issues a hot reset to our device.
* The following routine does a 1s wait after the reset is dropped
* per PCI Trhfa (recovery time). PCIe 3.0 section 6.6.1 -
* Conventional Reset, paragraph 3, line 35 also says that a 1s
* delay after a reset is required. Per spec requirements,
* the link is either working or not after that point.
* This is an end around to do an SBR during probe time. A new API needs
* to be implemented to have cleaner interface but this fixes the
* current brokenness
*/
return pci_reset_bus(dev);
return pci_bridge_secondary_bus_reset(dev->bus->self);
}

/*
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4547,6 +4547,7 @@ int pci_bridge_secondary_bus_reset(struct pci_dev *dev)

return pci_dev_wait(dev, "bus reset", PCIE_RESET_READY_POLL_MS);
}
EXPORT_SYMBOL_GPL(pci_bridge_secondary_bus_reset);

static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
{
Expand Down
3 changes: 3 additions & 0 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,9 @@ void pci_bus_remove_resources(struct pci_bus *bus);
int devm_request_pci_bus_resources(struct device *dev,
struct list_head *resources);

/* Temporary until new and working PCI SBR API in place */
int pci_bridge_secondary_bus_reset(struct pci_dev *dev);

#define pci_bus_for_each_resource(bus, res, i) \
for (i = 0; \
(res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \
Expand Down

0 comments on commit bfc4560

Please sign in to comment.