From feb641e932e828b53460280e6ec4ee72eec681fd Mon Sep 17 00:00:00 2001 From: Ross Philipson Date: Wed, 1 Apr 2009 09:34:42 -0400 Subject: [PATCH] Fixed SBR code to no include any PCIe bridges in the list of devices. Changes to be committed: modified: drivers/xen/pciback/pciback_ops.c --- drivers/xen/pciback/pciback_ops.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/xen/pciback/pciback_ops.c b/drivers/xen/pciback/pciback_ops.c index be8e3ec2..e4a96b50 100644 --- a/drivers/xen/pciback/pciback_ops.c +++ b/drivers/xen/pciback/pciback_ops.c @@ -113,7 +113,9 @@ static void pciback_cleanup_sbr_list(struct pcistub_sbr_list *list) /* 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) @@ -131,16 +133,14 @@ static int pciback_get_sbr_list(struct pci_dev *dev, 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; -- 2.39.5