These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / arch / powerpc / kernel / pci-common.c
index 0d05406..0f7a60f 100644 (file)
@@ -89,6 +89,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
 #endif
        return phb;
 }
+EXPORT_SYMBOL_GPL(pcibios_alloc_controller);
 
 void pcibios_free_controller(struct pci_controller *phb)
 {
@@ -99,6 +100,7 @@ void pcibios_free_controller(struct pci_controller *phb)
        if (phb->is_dynamic)
                kfree(phb);
 }
+EXPORT_SYMBOL_GPL(pcibios_free_controller);
 
 /*
  * The function is used to return the minimal alignment
@@ -822,23 +824,15 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
                    (reg.start == 0 && !pci_has_flag(PCI_PROBE_ONLY))) {
                        /* Only print message if not re-assigning */
                        if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC))
-                               pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] "
-                                        "is unassigned\n",
-                                        pci_name(dev), i,
-                                        (unsigned long long)res->start,
-                                        (unsigned long long)res->end,
-                                        (unsigned int)res->flags);
+                               pr_debug("PCI:%s Resource %d %pR is unassigned\n",
+                                        pci_name(dev), i, res);
                        res->end -= res->start;
                        res->start = 0;
                        res->flags |= IORESOURCE_UNSET;
                        continue;
                }
 
-               pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]\n",
-                        pci_name(dev), i,
-                        (unsigned long long)res->start,\
-                        (unsigned long long)res->end,
-                        (unsigned int)res->flags);
+               pr_debug("PCI:%s Resource %d %pR\n", pci_name(dev), i, res);
        }
 
        /* Call machine specific resource fixup */
@@ -942,11 +936,7 @@ static void pcibios_fixup_bridge(struct pci_bus *bus)
                        continue;
                }
 
-               pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x]\n",
-                        pci_name(dev), i,
-                        (unsigned long long)res->start,\
-                        (unsigned long long)res->end,
-                        (unsigned int)res->flags);
+               pr_debug("PCI:%s Bus rsrc %d %pR\n", pci_name(dev), i, res);
 
                /* Try to detect uninitialized P2P bridge resources,
                 * and clear them out so they get re-assigned later
@@ -1131,10 +1121,8 @@ static int reparent_resources(struct resource *parent,
        *pp = NULL;
        for (p = res->child; p != NULL; p = p->sibling) {
                p->parent = res;
-               pr_debug("PCI: Reparented %s [%llx..%llx] under %s\n",
-                        p->name,
-                        (unsigned long long)p->start,
-                        (unsigned long long)p->end, res->name);
+               pr_debug("PCI: Reparented %s %pR under %s\n",
+                        p->name, p, res->name);
        }
        return 0;
 }
@@ -1203,14 +1191,9 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus)
                        }
                }
 
-               pr_debug("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx "
-                        "[0x%x], parent %p (%s)\n",
-                        bus->self ? pci_name(bus->self) : "PHB",
-                        bus->number, i,
-                        (unsigned long long)res->start,
-                        (unsigned long long)res->end,
-                        (unsigned int)res->flags,
-                        pr, (pr && pr->name) ? pr->name : "nil");
+               pr_debug("PCI: %s (bus %d) bridge rsrc %d: %pR, parent %p (%s)\n",
+                        bus->self ? pci_name(bus->self) : "PHB", bus->number,
+                        i, res, pr, (pr && pr->name) ? pr->name : "nil");
 
                if (pr && !(pr->flags & IORESOURCE_UNSET)) {
                        struct pci_dev *dev = bus->self;
@@ -1252,11 +1235,8 @@ static inline void alloc_resource(struct pci_dev *dev, int idx)
 {
        struct resource *pr, *r = &dev->resource[idx];
 
-       pr_debug("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n",
-                pci_name(dev), idx,
-                (unsigned long long)r->start,
-                (unsigned long long)r->end,
-                (unsigned int)r->flags);
+       pr_debug("PCI: Allocating %s: Resource %d: %pR\n",
+                pci_name(dev), idx, r);
 
        pr = pci_find_parent_resource(dev, r);
        if (!pr || (pr->flags & IORESOURCE_UNSET) ||
@@ -1264,11 +1244,7 @@ static inline void alloc_resource(struct pci_dev *dev, int idx)
                printk(KERN_WARNING "PCI: Cannot allocate resource region %d"
                       " of device %s, will remap\n", idx, pci_name(dev));
                if (pr)
-                       pr_debug("PCI:  parent is %p: %016llx-%016llx [%x]\n",
-                                pr,
-                                (unsigned long long)pr->start,
-                                (unsigned long long)pr->end,
-                                (unsigned int)pr->flags);
+                       pr_debug("PCI:  parent is %p: %pR\n", pr, pr);
                /* We'll assign a new address later */
                r->flags |= IORESOURCE_UNSET;
                r->end -= r->start;
@@ -1430,12 +1406,8 @@ void pcibios_claim_one_bus(struct pci_bus *bus)
                        if (r->parent || !r->start || !r->flags)
                                continue;
 
-                       pr_debug("PCI: Claiming %s: "
-                                "Resource %d: %016llx..%016llx [%x]\n",
-                                pci_name(dev), i,
-                                (unsigned long long)r->start,
-                                (unsigned long long)r->end,
-                                (unsigned int)r->flags);
+                       pr_debug("PCI: Claiming %s: Resource %d: %pR\n",
+                                pci_name(dev), i, r);
 
                        if (pci_claim_resource(dev, i) == 0)
                                continue;
@@ -1447,6 +1419,7 @@ void pcibios_claim_one_bus(struct pci_bus *bus)
        list_for_each_entry(child_bus, &bus->children, node)
                pcibios_claim_one_bus(child_bus);
 }
+EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
 
 
 /* pcibios_finish_adding_to_bus
@@ -1488,6 +1461,14 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
        return pci_enable_resources(dev, mask);
 }
 
+void pcibios_disable_device(struct pci_dev *dev)
+{
+       struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+       if (phb->controller_ops.disable_device)
+               phb->controller_ops.disable_device(dev);
+}
+
 resource_size_t pcibios_io_space_offset(struct pci_controller *hose)
 {
        return (unsigned long) hose->io_base_virt - _IO_BASE;
@@ -1510,11 +1491,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
        } else {
                offset = pcibios_io_space_offset(hose);
 
-               pr_debug("PCI: PHB IO resource    = %08llx-%08llx [%lx] off 0x%08llx\n",
-                        (unsigned long long)res->start,
-                        (unsigned long long)res->end,
-                        (unsigned long)res->flags,
-                        (unsigned long long)offset);
+               pr_debug("PCI: PHB IO resource    = %pR off 0x%08llx\n",
+                        res, (unsigned long long)offset);
                pci_add_resource_offset(resources, res, offset);
        }
 
@@ -1531,11 +1509,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
                offset = hose->mem_offset[i];
 
 
-               pr_debug("PCI: PHB MEM resource %d = %08llx-%08llx [%lx] off 0x%08llx\n", i,
-                        (unsigned long long)res->start,
-                        (unsigned long long)res->end,
-                        (unsigned long)res->flags,
-                        (unsigned long long)offset);
+               pr_debug("PCI: PHB MEM resource %d = %pR off 0x%08llx\n", i,
+                        res, (unsigned long long)offset);
 
                pci_add_resource_offset(resources, res, offset);
        }
@@ -1680,6 +1655,7 @@ void pcibios_scan_phb(struct pci_controller *hose)
                        pcie_bus_configure_settings(child);
        }
 }
+EXPORT_SYMBOL_GPL(pcibios_scan_phb);
 
 static void fixup_hide_host_resource_fsl(struct pci_dev *dev)
 {