Merge branch 'pci/trivial'
[platform/kernel/linux-rpi.git] / drivers / pci / probe.c
index 4afe327..512cb43 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/pci.h>
+#include <linux/msi.h>
 #include <linux/of_device.h>
 #include <linux/of_pci.h>
 #include <linux/pci_hotplug.h>
@@ -572,6 +573,7 @@ static void devm_pci_release_host_bridge_dev(struct device *dev)
                bridge->release_fn(bridge);
 
        pci_free_resource_list(&bridge->windows);
+       pci_free_resource_list(&bridge->dma_ranges);
 }
 
 static void pci_release_host_bridge_dev(struct device *dev)
@@ -897,6 +899,9 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
        else
                pr_info("PCI host bridge to bus %s\n", name);
 
+       if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE)
+               dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n");
+
        /* Add initial resources to the bus */
        resource_list_for_each_entry_safe(window, n, &resources) {
                list_move_tail(&window->node, &bridge->windows);
@@ -1089,14 +1094,15 @@ static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus,
  * @sec: updated with secondary bus number from EA
  * @sub: updated with subordinate bus number from EA
  *
- * If @dev is a bridge with EA capability, update @sec and @sub with
- * fixed bus numbers from the capability and return true.  Otherwise,
- * return false.
+ * If @dev is a bridge with EA capability that specifies valid secondary
+ * and subordinate bus numbers, return true with the bus numbers in @sec
+ * and @sub.  Otherwise return false.
  */
 static bool pci_ea_fixed_busnrs(struct pci_dev *dev, u8 *sec, u8 *sub)
 {
        int ea, offset;
        u32 dw;
+       u8 ea_sec, ea_sub;
 
        if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE)
                return false;
@@ -1108,8 +1114,13 @@ static bool pci_ea_fixed_busnrs(struct pci_dev *dev, u8 *sec, u8 *sub)
 
        offset = ea + PCI_EA_FIRST_ENT;
        pci_read_config_dword(dev, offset, &dw);
-       *sec =  dw & PCI_EA_SEC_BUS_MASK;
-       *sub = (dw & PCI_EA_SUB_BUS_MASK) >> PCI_EA_SUB_BUS_SHIFT;
+       ea_sec =  dw & PCI_EA_SEC_BUS_MASK;
+       ea_sub = (dw & PCI_EA_SUB_BUS_MASK) >> PCI_EA_SUB_BUS_SHIFT;
+       if (ea_sec  == 0 || ea_sub < ea_sec)
+               return false;
+
+       *sec = ea_sec;
+       *sub = ea_sub;
        return true;
 }
 
@@ -2313,6 +2324,8 @@ static void pci_init_capabilities(struct pci_dev *dev)
        pci_configure_ari(dev);         /* Alternative Routing-ID Forwarding */
        pci_iov_init(dev);              /* Single Root I/O Virtualization */
        pci_ats_init(dev);              /* Address Translation Services */
+       pci_pri_init(dev);              /* Page Request Interface */
+       pci_pasid_init(dev);            /* Process Address Space ID */
        pci_enable_acs(dev);            /* Enable ACS P2P upstream forwarding */
        pci_ptm_init(dev);              /* Precision Time Measurement */
        pci_aer_init(dev);              /* Advanced Error Reporting */