/* Routine to find all devices and bridges that need to be reset
* during a secondary bus reset. For PCIe this is simply all the
* functions on the particular device. For PCI this is all devices
- * and bridges below the topmost PCI/PCI-X bridge.
+ * and bridges below the topmost PCI/PCI-X bridge. Note for PCI,
+ * there is at least one something->PCI/PCI-X bridge to find since
+ * the device is not on the host bus 0 and is on a PCI bus.
*/
static int pciback_get_sbr_list(struct pci_dev *dev,
struct pcistub_sbr_list *list, int pcie_endpoint)
while (bridge) {
/* Looking for the uppermost PCI/PCI-X bridge. If it is not PCIe then
* this is a PCI/PCI-X bridge. If it is PCIe then except the PCIe to
- * PCI/PCI-X type 7, the reset of the bridge types are PCIe so the last
- * bridge encountered was the topmost PCI/PCI-X bridge which may be NULL.
+ * PCI/PCI-X type 7, the rest of the bridge types are PCIe so the last
+ * bridge encountered was the topmost PCI/PCI-X bridge.
*/
exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
if (exp_pos != 0) {
pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
- if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE) {
- last = bridge;
- break;
- }
+ if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE)
+ break; /* don't want it in the list if it is a PCIe bridge */
}
last = bridge;
bridge = last->bus->self;