]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
Fixed SBR code to no include any PCIe bridges in the list of devices.
authorRoss Philipson <ross.philipson@citrix.com>
Wed, 1 Apr 2009 13:34:42 +0000 (09:34 -0400)
committerRoss Philipson <ross.philipson@citrix.com>
Wed, 1 Apr 2009 13:34:42 +0000 (09:34 -0400)
 Changes to be committed:
modified:   drivers/xen/pciback/pciback_ops.c

drivers/xen/pciback/pciback_ops.c

index be8e3ec28743e5194f131eb3c2e4edf4450824e5..e4a96b50bb65732603a75ee3a86a63f00290c4cd 100644 (file)
@@ -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;