]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'pci/misc' into next
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 31 Oct 2013 20:12:40 +0000 (14:12 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 31 Oct 2013 20:12:40 +0000 (14:12 -0600)
* pci/misc:
  PCI: Report pci_pme_active() kmalloc failure
  mn10300/PCI: Remove useless pcibios_last_bus
  frv/PCI: Remove pcibios_last_bus
  PCI: Fail MSI/MSI-X initialization if device is not in PCI_D0
  x86/PCI: Coalesce multiple overlapping host bridge windows
  MAINTAINERS: Add arch/x86/pci to PCI file patterns
  PCI/PM: Remove pci_pm_complete()
  PCI: Add pci_dev_show_local_cpu() to simplify code
  mn10300/PCI: Remove unused pci_mem_start
  cris/PCI: Remove unused pci_mem_start
  PCI: Make pci_dev_pm_ops static

Conflicts:
drivers/pci/pci-sysfs.c

13 files changed:
MAINTAINERS
arch/cris/include/asm/pci.h
arch/frv/mb93090-mb00/pci-frv.h
arch/frv/mb93090-mb00/pci-vdk.c
arch/mn10300/include/asm/pci.h
arch/mn10300/kernel/setup.c
arch/mn10300/unit-asb2305/pci-asb2305.h
arch/mn10300/unit-asb2305/pci.c
arch/x86/pci/acpi.c
drivers/pci/msi.c
drivers/pci/pci-driver.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.c

index bc6d82162ebe58278f7644b5a41a1a0acfdf2528..906d440f1afe7090ea4730c95194f640173f6e02 100644 (file)
@@ -6338,6 +6338,7 @@ S:        Supported
 F:     Documentation/PCI/
 F:     drivers/pci/
 F:     include/linux/pci*
+F:     arch/x86/pci/
 
 PCI DRIVER FOR NVIDIA TEGRA
 M:     Thierry Reding <thierry.reding@gmail.com>
index 146da904cdd84c83fa67d5c3e88ca74f25bd8648..f666734926d548a233e6ab5e5bc810cb48c3d67a 100644 (file)
@@ -11,7 +11,6 @@
 
 #define pcibios_assign_all_busses(void) 1
 
-extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO         0x1000
 #define PCIBIOS_MIN_MEM                0x10000000
 
index 76c4e73d643d3f8c7dea7d3b59546489aa6f7d96..a7e487fe76edeaf7cf36846e779481535e13eb5e 100644 (file)
@@ -30,7 +30,6 @@ void pcibios_resource_survey(void);
 
 /* pci-vdk.c */
 
-extern int __nongpreldata pcibios_last_bus;
 extern struct pci_ops *__nongpreldata pci_root_ops;
 
 /* pci-irq.c */
index deb67843693cddbf94ce2c2044999730a9425845..efa5d65b000789e9bc7615d1e1e4335be2eb06c6 100644 (file)
@@ -25,7 +25,6 @@
 
 unsigned int __nongpreldata pci_probe = 1;
 
-int  __nongpreldata pcibios_last_bus = -1;
 struct pci_ops *__nongpreldata pci_root_ops;
 
 /*
@@ -219,37 +218,6 @@ static struct pci_ops * __init pci_check_direct(void)
        return NULL;
 }
 
-/*
- * Discover remaining PCI buses in case there are peer host bridges.
- * We use the number of last PCI bus provided by the PCI BIOS.
- */
-static void __init pcibios_fixup_peer_bridges(void)
-{
-       struct pci_bus bus;
-       struct pci_dev dev;
-       int n;
-       u16 l;
-
-       if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff)
-               return;
-       printk("PCI: Peer bridge fixup\n");
-       for (n=0; n <= pcibios_last_bus; n++) {
-               if (pci_find_bus(0, n))
-                       continue;
-               bus.number = n;
-               bus.ops = pci_root_ops;
-               dev.bus = &bus;
-               for(dev.devfn=0; dev.devfn<256; dev.devfn += 8)
-                       if (!pci_read_config_word(&dev, PCI_VENDOR_ID, &l) &&
-                           l != 0x0000 && l != 0xffff) {
-                               printk("Found device at %02x:%02x [%04x]\n", n, dev.devfn, l);
-                               printk("PCI: Discovered peer bus %02x\n", n);
-                               pci_scan_bus(n, pci_root_ops, NULL);
-                               break;
-                       }
-       }
-}
-
 /*
  * Exceptions for specific devices. Usually work-arounds for fatal design flaws.
  */
@@ -418,7 +386,6 @@ int __init pcibios_init(void)
        pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources);
 
        pcibios_irq_init();
-       pcibios_fixup_peer_bridges();
        pcibios_fixup_irqs();
        pcibios_resource_survey();
 
@@ -432,9 +399,6 @@ char * __init pcibios_setup(char *str)
        if (!strcmp(str, "off")) {
                pci_probe = 0;
                return NULL;
-       } else if (!strncmp(str, "lastbus=", 8)) {
-               pcibios_last_bus = simple_strtol(str+8, NULL, 0);
-               return NULL;
        }
        return str;
 }
index 6f31cc0f1a878139dc4ac233d89f8f1d22f93379..166323824683c50fc0aa3eb2575159e760a78458 100644 (file)
@@ -44,7 +44,6 @@ extern void unit_pci_init(void);
 #define pcibios_assign_all_busses()    0
 #endif
 
-extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO         0xBE000004
 #define PCIBIOS_MIN_MEM                0xB8000000
 
index ebac9c11f7966cbb6a52ebeefa7bb17579d727d6..2ad7f32fa122d7131c09c81b2ac0146664df5694 100644 (file)
@@ -35,9 +35,6 @@
 
 struct mn10300_cpuinfo boot_cpu_data;
 
-/* For PCI or other memory-mapped resources */
-unsigned long pci_mem_start = 0x18000000;
-
 static char __initdata cmd_line[COMMAND_LINE_SIZE];
 char redboot_command_line[COMMAND_LINE_SIZE] =
        "console=ttyS0,115200 root=/dev/mtdblock3 rw";
index 7fa66a0e462423d8a415dca78ad24b014aca89c7..9e17aca5a2a19871d939d697a3688b454fcda578 100644 (file)
@@ -35,7 +35,6 @@ extern void pcibios_resource_survey(void);
 
 /* pci.c */
 
-extern int pcibios_last_bus;
 extern struct pci_ops *pci_root_ops;
 
 extern struct irq_routing_table *pcibios_get_irq_routing_table(void);
index e37fac0461f3351ae6284ca011f3fcb0d80cc906..6b4339f8c9c2e1e757f13fddccb9053c2c292b0c 100644 (file)
@@ -24,7 +24,6 @@
 
 unsigned int pci_probe = 1;
 
-int pcibios_last_bus = -1;
 struct pci_ops *pci_root_ops;
 
 /*
@@ -392,10 +391,6 @@ char *__init pcibios_setup(char *str)
        if (!strcmp(str, "off")) {
                pci_probe = 0;
                return NULL;
-
-       } else if (!strncmp(str, "lastbus=", 8)) {
-               pcibios_last_bus = simple_strtol(str+8, NULL, 0);
-               return NULL;
        }
 
        return str;
index b30e937689d617cee4b37775f70bc8e001af0441..7fb24e53d4c8b88b1fd374a327e0535269f7e328 100644 (file)
@@ -354,12 +354,12 @@ static void coalesce_windows(struct pci_root_info *info, unsigned long type)
                         * the kernel resource tree doesn't allow overlaps.
                         */
                        if (resource_overlaps(res1, res2)) {
-                               res1->start = min(res1->start, res2->start);
-                               res1->end = max(res1->end, res2->end);
+                               res2->start = min(res1->start, res2->start);
+                               res2->end = max(res1->end, res2->end);
                                dev_info(&info->bridge->dev,
                                         "host bridge window expanded to %pR; %pR ignored\n",
-                                        res1, res2);
-                               res2->flags = 0;
+                                        res2, res1);
+                               res1->flags = 0;
                        }
                }
        }
index d5f90d6383bc38660dcaba3786adcbf1e78a936b..604265c408534eff2d65436660591fbac3e9b5f7 100644 (file)
@@ -831,7 +831,7 @@ int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec)
        int status, maxvec;
        u16 msgctl;
 
-       if (!dev->msi_cap)
+       if (!dev->msi_cap || dev->current_state != PCI_D0)
                return -EINVAL;
 
        pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &msgctl);
@@ -862,7 +862,7 @@ int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec)
        int ret, nvec;
        u16 msgctl;
 
-       if (!dev->msi_cap)
+       if (!dev->msi_cap || dev->current_state != PCI_D0)
                return -EINVAL;
 
        pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &msgctl);
@@ -955,7 +955,7 @@ int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec)
        int status, nr_entries;
        int i, j;
 
-       if (!entries || !dev->msix_cap)
+       if (!entries || !dev->msix_cap || dev->current_state != PCI_D0)
                return -EINVAL;
 
        status = pci_msi_check_device(dev, nvec, PCI_CAP_ID_MSIX);
index 9f85960a62ed51a02a625fb8593134634ae6afd1..840fdc5ba0d8110bd1e94272cc070d37d38ca822 100644 (file)
@@ -602,18 +602,10 @@ static int pci_pm_prepare(struct device *dev)
        return error;
 }
 
-static void pci_pm_complete(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
-}
 
 #else /* !CONFIG_PM_SLEEP */
 
 #define pci_pm_prepare NULL
-#define pci_pm_complete        NULL
 
 #endif /* !CONFIG_PM_SLEEP */
 
@@ -1124,9 +1116,8 @@ static int pci_pm_runtime_idle(struct device *dev)
 
 #ifdef CONFIG_PM
 
-const struct dev_pm_ops pci_dev_pm_ops = {
+static const struct dev_pm_ops pci_dev_pm_ops = {
        .prepare = pci_pm_prepare,
-       .complete = pci_pm_complete,
        .suspend = pci_pm_suspend,
        .resume = pci_pm_resume,
        .freeze = pci_pm_freeze,
index 82cc45867eaad40d03fe8982e0cd7f4d736bd939..2aaa83c85a4edbfa9d587b05a79507292ea7c751 100644 (file)
@@ -76,9 +76,11 @@ static ssize_t broken_parity_status_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(broken_parity_status);
 
-static ssize_t local_cpus_show(struct device *dev,
-                       struct device_attribute *attr, char *buf)
-{              
+static ssize_t pci_dev_show_local_cpu(struct device *dev,
+               int type,
+               struct device_attribute *attr,
+               char *buf)
+{
        const struct cpumask *mask;
        int len;
 
@@ -88,29 +90,26 @@ static ssize_t local_cpus_show(struct device *dev,
 #else
        mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
 #endif
-       len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
+       len = type ?
+               cpumask_scnprintf(buf, PAGE_SIZE-2, mask) :
+               cpulist_scnprintf(buf, PAGE_SIZE-2, mask);
+
        buf[len++] = '\n';
        buf[len] = '\0';
        return len;
 }
+
+static ssize_t local_cpus_show(struct device *dev,
+                       struct device_attribute *attr, char *buf)
+{
+       return pci_dev_show_local_cpu(dev, 1, attr, buf);
+}
 static DEVICE_ATTR_RO(local_cpus);
 
 static ssize_t local_cpulist_show(struct device *dev,
                        struct device_attribute *attr, char *buf)
 {
-       const struct cpumask *mask;
-       int len;
-
-#ifdef CONFIG_NUMA
-       mask = (dev_to_node(dev) == -1) ? cpu_online_mask :
-                                         cpumask_of_node(dev_to_node(dev));
-#else
-       mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
-#endif
-       len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask);
-       buf[len++] = '\n';
-       buf[len] = '\0';
-       return len;
+       return pci_dev_show_local_cpu(dev, 0, attr, buf);
 }
 static DEVICE_ATTR_RO(local_cpulist);
 
index c0805f26f339715a7e237aa2d5901fb8527f901c..457f801fc49d175280c686d77bb53af76a30e2e2 100644 (file)
@@ -1638,8 +1638,10 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
                if (enable) {
                        pme_dev = kmalloc(sizeof(struct pci_pme_device),
                                          GFP_KERNEL);
-                       if (!pme_dev)
-                               goto out;
+                       if (!pme_dev) {
+                               dev_warn(&dev->dev, "can't enable PME#\n");
+                               return;
+                       }
                        pme_dev->dev = dev;
                        mutex_lock(&pci_pme_list_mutex);
                        list_add(&pme_dev->list, &pci_pme_list);
@@ -1660,7 +1662,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
                }
        }
 
-out:
        dev_dbg(&dev->dev, "PME# %s\n", enable ? "enabled" : "disabled");
 }