]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge branches 'dma-api', 'pci/virtualization', 'pci/msi', 'pci/misc' and 'pci/resour...
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 26 May 2014 23:29:17 +0000 (17:29 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 26 May 2014 23:29:17 +0000 (17:29 -0600)
* dma-api:
  iommu/exynos: Remove unnecessary "&" from function pointers
  DMA-API: Update dma_pool_create ()and dma_pool_alloc() descriptions
  DMA-API: Fix duplicated word in DMA-API-HOWTO.txt
  DMA-API: Capitalize "CPU" consistently
  sh/PCI: Pass GAPSPCI_DMA_BASE CPU & bus address to dma_declare_coherent_memory()
  DMA-API: Change dma_declare_coherent_memory() CPU address to phys_addr_t
  DMA-API: Clarify physical/bus address distinction

* pci/virtualization:
  PCI: Mark RTL8110SC INTx masking as broken

* pci/msi:
  PCI/MSI: Remove pci_enable_msi_block()

* pci/misc:
  PCI: Remove pcibios_add_platform_entries()
  s390/pci: use pdev->dev.groups for attribute creation
  PCI: Move Open Firmware devspec attribute to PCI common code

* pci/resource:
  PCI: Add resource allocation comments
  PCI: Simplify __pci_assign_resource() coding style
  PCI: Change pbus_size_mem() return values to be more conventional
  PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources
  PCI: Support BAR sizes up to 8GB
  resources: Clarify sanity check message
  PCI: Don't add disabled subtractive decode bus resources
  PCI: Don't print anything while decoding is disabled
  PCI: Don't set BAR to zero if dma_addr_t is too small
  PCI: Don't convert BAR address to resource if dma_addr_t is too small
  PCI: Reject BAR above 4GB if dma_addr_t is too small
  PCI: Fail safely if we can't handle BARs larger than 4GB
  x86/gart: Tidy messages and add bridge device info
  x86/gart: Replace printk() with pr_info()
  x86/PCI: Move pcibios_assign_resources() annotation to definition
  x86/PCI: Mark ATI SBx00 HPET BAR as IORESOURCE_PCI_FIXED
  x86/PCI: Don't try to move IORESOURCE_PCI_FIXED resources
  x86/PCI: Fix Broadcom CNB20LE unintended sign extension

40 files changed:
Documentation/ABI/testing/sysfs-bus-pci
MAINTAINERS
arch/microblaze/pci/pci-common.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_64.c
arch/s390/include/asm/pci.h
arch/s390/pci/pci.c
arch/s390/pci/pci_sysfs.c
arch/x86/kernel/aperture_64.c
arch/x86/pci/broadcom_bus.c
arch/x86/pci/fixup.c
arch/x86/pci/i386.c
drivers/misc/genwqe/card_utils.c
drivers/pci/bus.c
drivers/pci/host-bridge.c
drivers/pci/hotplug-pci.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/cpci_hotplug_pci.c
drivers/pci/hotplug/cpqphp_nvram.c
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/hotplug/pcihp_slot.c
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/hotplug/s390_pci_hpc.c
drivers/pci/hotplug/shpchp_pci.c
drivers/pci/msi.c
drivers/pci/pci-driver.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/pcie/portdrv_core.c
drivers/pci/probe.c
drivers/pci/quirks.c
drivers/pci/search.c
drivers/pci/setup-bus.c
drivers/pci/setup-irq.c
drivers/pci/setup-res.c
include/linux/pci.h
include/linux/pci_ids.h
kernel/resource.c

index a3c5a6685036103e7ec677272acdc4620d0302f6..ab8d76dfaa8096bbdf42bacf31336b856c07959b 100644 (file)
@@ -117,7 +117,7 @@ Description:
 
 What:          /sys/bus/pci/devices/.../vpd
 Date:          February 2008
-Contact:       Ben Hutchings <bhutchings@solarflare.com>
+Contact:       Ben Hutchings <bwh@kernel.org>
 Description:
                A file named vpd in a device directory will be a
                binary file containing the Vital Product Data for the
index 6dc67b1fdb507016d0d0d77bf66f9875ace00f99..8dbea21d973dc7cfd912aea0543a561e996b07cc 100644 (file)
@@ -6693,6 +6693,7 @@ F:        Documentation/PCI/
 F:     drivers/pci/
 F:     include/linux/pci*
 F:     arch/x86/pci/
+F:     arch/x86/kernel/quirks.c
 
 PCI DRIVER FOR IMX6
 M:     Richard Zhu <r65037@freescale.com>
index 70996cc66aa228c688d298ade87fd31c5cedaaac..a59de1bc1ce0cca8976ea6cb9bf0ebde4562ddd3 100644 (file)
@@ -168,26 +168,6 @@ struct pci_controller *pci_find_hose_for_OF_device(struct device_node *node)
        return NULL;
 }
 
-static ssize_t pci_show_devspec(struct device *dev,
-               struct device_attribute *attr, char *buf)
-{
-       struct pci_dev *pdev;
-       struct device_node *np;
-
-       pdev = to_pci_dev(dev);
-       np = pci_device_to_OF_node(pdev);
-       if (np == NULL || np->full_name == NULL)
-               return 0;
-       return sprintf(buf, "%s", np->full_name);
-}
-static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
-
-/* Add sysfs properties */
-int pcibios_add_platform_entries(struct pci_dev *pdev)
-{
-       return device_create_file(&pdev->dev, &dev_attr_devspec);
-}
-
 void pcibios_set_master(struct pci_dev *dev)
 {
        /* No special bus mastering setup handling */
index d9476c1fc9596132d27bc68d5795e2b6a3ee8a6a..24d342e917903f58aec6e37d56616aab0e1e029d 100644 (file)
@@ -201,26 +201,6 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
        return NULL;
 }
 
-static ssize_t pci_show_devspec(struct device *dev,
-               struct device_attribute *attr, char *buf)
-{
-       struct pci_dev *pdev;
-       struct device_node *np;
-
-       pdev = to_pci_dev (dev);
-       np = pci_device_to_OF_node(pdev);
-       if (np == NULL || np->full_name == NULL)
-               return 0;
-       return sprintf(buf, "%s", np->full_name);
-}
-static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
-
-/* Add sysfs properties */
-int pcibios_add_platform_entries(struct pci_dev *pdev)
-{
-       return device_create_file(&pdev->dev, &dev_attr_devspec);
-}
-
 /*
  * Reads the interrupt pin to determine if interrupt is use by card.
  * If the interrupt is used, then gets the interrupt line from the
index 2a4779091a5809a42b64d187224dc46da59fa07c..155013da27e05cb801ba961b102d41f3edbfb48d 100644 (file)
@@ -208,7 +208,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
                          unsigned long in_devfn)
 {
        struct pci_controller* hose;
-       struct pci_bus *bus = NULL;
+       struct pci_bus *tmp_bus, *bus = NULL;
        struct device_node *hose_node;
 
        /* Argh ! Please forgive me for that hack, but that's the
@@ -229,10 +229,12 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
         * used on pre-domains setup. We return the first match
         */
 
-       list_for_each_entry(bus, &pci_root_buses, node) {
-               if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
+       list_for_each_entry(tmp_bus, &pci_root_buses, node) {
+               if (in_bus >= tmp_bus->number &&
+                   in_bus <= tmp_bus->busn_res.end) {
+                       bus = tmp_bus;
                        break;
-               bus = NULL;
+               }
        }
        if (bus == NULL || bus->dev.of_node == NULL)
                return -ENODEV;
index 2583466f576b617181ed8b39f1db6c32106bd999..79b5f0783a30c3f9861c374d5a2cb0f2bb002fa4 100644 (file)
@@ -120,6 +120,8 @@ static inline bool zdev_enabled(struct zpci_dev *zdev)
        return (zdev->fh & (1UL << 31)) ? true : false;
 }
 
+extern const struct attribute_group *zpci_attr_groups[];
+
 /* -----------------------------------------------------------------------------
   Prototypes
 ----------------------------------------------------------------------------- */
@@ -166,10 +168,6 @@ static inline void zpci_exit_slot(struct zpci_dev *zdev) {}
 struct zpci_dev *get_zdev(struct pci_dev *);
 struct zpci_dev *get_zdev_by_fid(u32);
 
-/* sysfs */
-int zpci_sysfs_add_device(struct device *);
-void zpci_sysfs_remove_device(struct device *);
-
 /* DMA */
 int zpci_dma_init(void);
 void zpci_dma_exit(void);
index 1df1d29ac81d3710caafad1f7ce0094f530d721d..bdf02570d1dfab0c81146b4b609cbe45c9b445d7 100644 (file)
@@ -530,11 +530,6 @@ static void zpci_unmap_resources(struct zpci_dev *zdev)
        }
 }
 
-int pcibios_add_platform_entries(struct pci_dev *pdev)
-{
-       return zpci_sysfs_add_device(&pdev->dev);
-}
-
 static int __init zpci_irq_init(void)
 {
        int rc;
@@ -671,6 +666,7 @@ int pcibios_add_device(struct pci_dev *pdev)
        int i;
 
        zdev->pdev = pdev;
+       pdev->dev.groups = zpci_attr_groups;
        zpci_map_resources(zdev);
 
        for (i = 0; i < PCI_BAR_COUNT; i++) {
index ab4a91393005a920b876c610ed5d3d8605af5037..b56a3958f1a7125e1bfa97c293bbbc88879e598b 100644 (file)
@@ -72,36 +72,18 @@ static ssize_t store_recover(struct device *dev, struct device_attribute *attr,
 }
 static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover);
 
-static struct device_attribute *zpci_dev_attrs[] = {
-       &dev_attr_function_id,
-       &dev_attr_function_handle,
-       &dev_attr_pchid,
-       &dev_attr_pfgid,
-       &dev_attr_recover,
+static struct attribute *zpci_dev_attrs[] = {
+       &dev_attr_function_id.attr,
+       &dev_attr_function_handle.attr,
+       &dev_attr_pchid.attr,
+       &dev_attr_pfgid.attr,
+       &dev_attr_recover.attr,
+       NULL,
+};
+static struct attribute_group zpci_attr_group = {
+       .attrs = zpci_dev_attrs,
+};
+const struct attribute_group *zpci_attr_groups[] = {
+       &zpci_attr_group,
        NULL,
 };
-
-int zpci_sysfs_add_device(struct device *dev)
-{
-       int i, rc = 0;
-
-       for (i = 0; zpci_dev_attrs[i]; i++) {
-               rc = device_create_file(dev, zpci_dev_attrs[i]);
-               if (rc)
-                       goto error;
-       }
-       return 0;
-
-error:
-       while (--i >= 0)
-               device_remove_file(dev, zpci_dev_attrs[i]);
-       return rc;
-}
-
-void zpci_sysfs_remove_device(struct device *dev)
-{
-       int i;
-
-       for (i = 0; zpci_dev_attrs[i]; i++)
-               device_remove_file(dev, zpci_dev_attrs[i]);
-}
index 9fa8aa051f54b235ed516d32e2eca2c3c9d62b5e..76164e173a24f7251e3e684e66aa8afd7792f1e1 100644 (file)
@@ -10,6 +10,8 @@
  *
  * Copyright 2002 Andi Kleen, SuSE Labs.
  */
+#define pr_fmt(fmt) "AGP: " fmt
+
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
@@ -75,14 +77,13 @@ static u32 __init allocate_aperture(void)
        addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
                                      aper_size, aper_size);
        if (!addr) {
-               printk(KERN_ERR
-                       "Cannot allocate aperture memory hole (%lx,%uK)\n",
-                               addr, aper_size>>10);
+               pr_err("Cannot allocate aperture memory hole [mem %#010lx-%#010lx] (%uKB)\n",
+                      addr, addr + aper_size - 1, aper_size >> 10);
                return 0;
        }
        memblock_reserve(addr, aper_size);
-       printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
-                       aper_size >> 10, addr);
+       pr_info("Mapping aperture over RAM [mem %#010lx-%#010lx] (%uKB)\n",
+               addr, addr + aper_size - 1, aper_size >> 10);
        register_nosave_region(addr >> PAGE_SHIFT,
                               (addr+aper_size) >> PAGE_SHIFT);
 
@@ -126,10 +127,11 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
        u64 aper;
        u32 old_order;
 
-       printk(KERN_INFO "AGP bridge at %02x:%02x:%02x\n", bus, slot, func);
+       pr_info("pci 0000:%02x:%02x:%02x: AGP bridge\n", bus, slot, func);
        apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14);
        if (apsizereg == 0xffffffff) {
-               printk(KERN_ERR "APSIZE in AGP bridge unreadable\n");
+               pr_err("pci 0000:%02x:%02x.%d: APSIZE unreadable\n",
+                      bus, slot, func);
                return 0;
        }
 
@@ -153,16 +155,18 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
         * On some sick chips, APSIZE is 0. It means it wants 4G
         * so let double check that order, and lets trust AMD NB settings:
         */
-       printk(KERN_INFO "Aperture from AGP @ %Lx old size %u MB\n",
-                       aper, 32 << old_order);
+       pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (old size %uMB)\n",
+               bus, slot, func, aper, aper + (32ULL << (old_order + 20)) - 1,
+               32 << old_order);
        if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) {
-               printk(KERN_INFO "Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n",
-                               32 << *order, apsizereg);
+               pr_info("pci 0000:%02x:%02x.%d: AGP aperture size %uMB (APSIZE %#x) is not right, using settings from NB\n",
+                       bus, slot, func, 32 << *order, apsizereg);
                *order = old_order;
        }
 
-       printk(KERN_INFO "Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n",
-                       aper, 32 << *order, apsizereg);
+       pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (%uMB, APSIZE %#x)\n",
+               bus, slot, func, aper, aper + (32ULL << (*order + 20)) - 1,
+               32 << *order, apsizereg);
 
        if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20))
                return 0;
@@ -218,7 +222,7 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp)
                        }
                }
        }
-       printk(KERN_INFO "No AGP bridge found\n");
+       pr_info("No AGP bridge found\n");
 
        return 0;
 }
@@ -310,7 +314,8 @@ void __init early_gart_iommu_check(void)
                if (e820_any_mapped(aper_base, aper_base + aper_size,
                                    E820_RAM)) {
                        /* reserve it, so we can reuse it in second kernel */
-                       printk(KERN_INFO "update e820 for GART\n");
+                       pr_info("e820: reserve [mem %#010Lx-%#010Lx] for GART\n",
+                               aper_base, aper_base + aper_size - 1);
                        e820_add_region(aper_base, aper_size, E820_RESERVED);
                        update_e820();
                }
@@ -354,7 +359,7 @@ int __init gart_iommu_hole_init(void)
            !early_pci_allowed())
                return -ENODEV;
 
-       printk(KERN_INFO  "Checking aperture...\n");
+       pr_info("Checking aperture...\n");
 
        if (!fallback_aper_force)
                agp_aper_base = search_agp_bridge(&agp_aper_order, &valid_agp);
@@ -395,8 +400,9 @@ int __init gart_iommu_hole_init(void)
                        aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
                        aper_base <<= 25;
 
-                       printk(KERN_INFO "Node %d: aperture @ %Lx size %u MB\n",
-                                       node, aper_base, aper_size >> 20);
+                       pr_info("Node %d: aperture [bus addr %#010Lx-%#010Lx] (%uMB)\n",
+                               node, aper_base, aper_base + aper_size - 1,
+                               aper_size >> 20);
                        node++;
 
                        if (!aperture_valid(aper_base, aper_size, 64<<20)) {
@@ -407,9 +413,9 @@ int __init gart_iommu_hole_init(void)
                                        if (!no_iommu &&
                                            max_pfn > MAX_DMA32_PFN &&
                                            !printed_gart_size_msg) {
-                                               printk(KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n");
-                                               printk(KERN_ERR "please increase GART size in your BIOS setup\n");
-                                               printk(KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n");
+                                               pr_err("you are using iommu with agp, but GART size is less than 64MB\n");
+                                               pr_err("please increase GART size in your BIOS setup\n");
+                                               pr_err("if BIOS doesn't have that option, contact your HW vendor!\n");
                                                printed_gart_size_msg = 1;
                                        }
                                } else {
@@ -446,13 +452,10 @@ out:
                   force_iommu ||
                   valid_agp ||
                   fallback_aper_force) {
-               printk(KERN_INFO
-                       "Your BIOS doesn't leave a aperture memory hole\n");
-               printk(KERN_INFO
-                       "Please enable the IOMMU option in the BIOS setup\n");
-               printk(KERN_INFO
-                       "This costs you %d MB of RAM\n",
-                               32 << fallback_aper_order);
+               pr_info("Your BIOS doesn't leave a aperture memory hole\n");
+               pr_info("Please enable the IOMMU option in the BIOS setup\n");
+               pr_info("This costs you %dMB of RAM\n",
+                       32 << fallback_aper_order);
 
                aper_order = fallback_aper_order;
                aper_alloc = allocate_aperture();
index 614392ced7d6b620a2db74cbe2e113a5e9f24643..bb461cfd01abc78cdc45c6e69f013128e04ccdb4 100644 (file)
@@ -60,8 +60,8 @@ static void __init cnb20le_res(u8 bus, u8 slot, u8 func)
        word1 = read_pci_config_16(bus, slot, func, 0xc4);
        word2 = read_pci_config_16(bus, slot, func, 0xc6);
        if (word1 != word2) {
-               res.start = (word1 << 16) | 0x0000;
-               res.end   = (word2 << 16) | 0xffff;
+               res.start = ((resource_size_t) word1 << 16) | 0x0000;
+               res.end   = ((resource_size_t) word2 << 16) | 0xffff;
                res.flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
                update_res(info, res.start, res.end, res.flags, 0);
        }
index 94ae9ae9574fe1678eab5f65c219293a871c8c8a..ef334a003f3cc58c3e815e64f5e9837556b53b46 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/dmi.h>
 #include <linux/pci.h>
 #include <linux/vgaarb.h>
+#include <asm/hpet.h>
 #include <asm/pci_x86.h>
 
 static void pci_fixup_i450nx(struct pci_dev *d)
@@ -526,6 +527,19 @@ static void sb600_disable_hpet_bar(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar);
 
+#ifdef CONFIG_HPET_TIMER
+static void sb600_hpet_quirk(struct pci_dev *dev)
+{
+       struct resource *r = &dev->resource[1];
+
+       if (r->flags & IORESOURCE_MEM && r->start == hpet_address) {
+               r->flags |= IORESOURCE_PCI_FIXED;
+               dev_info(&dev->dev, "reg 0x14 contains HPET; making it immovable\n");
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, 0x4385, sb600_hpet_quirk);
+#endif
+
 /*
  * Twinhead H12Y needs us to block out a region otherwise we map devices
  * there and any access kills the box.
index db6b1ab43255f0179ae6d539197828ce6834c96f..a19ed92e74e4bde4bf058d822513e1b5c97c0fdd 100644 (file)
@@ -271,11 +271,16 @@ static void pcibios_allocate_dev_resources(struct pci_dev *dev, int pass)
                                        "BAR %d: reserving %pr (d=%d, p=%d)\n",
                                        idx, r, disabled, pass);
                                if (pci_claim_resource(dev, idx) < 0) {
-                                       /* We'll assign a new address later */
-                                       pcibios_save_fw_addr(dev,
-                                                       idx, r->start);
-                                       r->end -= r->start;
-                                       r->start = 0;
+                                       if (r->flags & IORESOURCE_PCI_FIXED) {
+                                               dev_info(&dev->dev, "BAR %d %pR is immovable\n",
+                                                        idx, r);
+                                       } else {
+                                               /* We'll assign a new address later */
+                                               pcibios_save_fw_addr(dev,
+                                                               idx, r->start);
+                                               r->end -= r->start;
+                                               r->start = 0;
+                                       }
                                }
                        }
                }
@@ -356,6 +361,12 @@ static int __init pcibios_assign_resources(void)
        return 0;
 }
 
+/**
+ * called in fs_initcall (one below subsys_initcall),
+ * give a chance for motherboard reserve resources
+ */
+fs_initcall(pcibios_assign_resources);
+
 void pcibios_resource_survey_bus(struct pci_bus *bus)
 {
        dev_printk(KERN_DEBUG, &bus->dev, "Allocating resources\n");
@@ -392,12 +403,6 @@ void __init pcibios_resource_survey(void)
        ioapic_insert_resources();
 }
 
-/**
- * called in fs_initcall (one below subsys_initcall),
- * give a chance for motherboard reserve resources
- */
-fs_initcall(pcibios_assign_resources);
-
 static const struct vm_operations_struct pci_mmap_ops = {
        .access = generic_access_phys,
 };
index 6b1a6ef9f1a8c3b1348218be489a59ac519d30c5..294f667ccab6279ea372718a72d7e0b0b6733db8 100644 (file)
@@ -628,7 +628,7 @@ int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count)
        int rc;
        struct pci_dev *pci_dev = cd->pci_dev;
 
-       rc = pci_enable_msi_block(pci_dev, count);
+       rc = pci_enable_msi_exact(pci_dev, count);
        if (rc == 0)
                cd->flags |= GENWQE_FLAG_MSI_ENABLED;
        return rc;
index fb8aed307c2821d70404dbac467fc94d914ed7e0..ba2bf55a38df52d99b1f7278560e9c0e9242248a 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/proc_fs.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 
 #include "pci.h"
index 47aaf22d814e195f7d397237a59267334ccf5ca2..0e5f3c95af5bd75d288d2067b79aacc6abd65a94 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/module.h>
 
index 6258dc260d9f54ac4423998e8b338d4333768ef7..c68366cee6b72efda08d590e29b67222d3b56e35 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/export.h>
 #include "pci.h"
 
-int __ref pci_hp_add_bridge(struct pci_dev *dev)
+int pci_hp_add_bridge(struct pci_dev *dev)
 {
        struct pci_bus *parent = dev->bus;
        int pass, busnr, start = parent->busn_res.start;
index bccc27ee10308f4d1ec388db248d1af1ab08aaba..bb945e33b1ecf23a1fc1aa1e4f44a1490491ef6e 100644 (file)
@@ -41,7 +41,6 @@
 
 #define pr_fmt(fmt) "acpiphp_glue: " fmt
 
-#include <linux/init.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -501,7 +500,7 @@ static int acpiphp_rescan_slot(struct acpiphp_slot *slot)
  * This function should be called per *physical slot*,
  * not per each slot object in ACPI namespace.
  */
-static void __ref enable_slot(struct acpiphp_slot *slot)
+static void enable_slot(struct acpiphp_slot *slot)
 {
        struct pci_dev *dev;
        struct pci_bus *bus = slot->bus;
index 8c1464851768140f0c31c27f60f04f93df0ff8c6..b238a1a2837223106a58df752a762a984575dea6 100644 (file)
@@ -250,7 +250,7 @@ int cpci_led_off(struct slot* slot)
  * Device configuration functions
  */
 
-int __ref cpci_configure_slot(struct slot *slot)
+int cpci_configure_slot(struct slot *slot)
 {
        struct pci_dev *dev;
        struct pci_bus *parent;
index 76ba8a1c774dfa716d947fc12092e82b8ebfef78..9600a392eaae8612436beadf4cc2373817b40c18 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/workqueue.h>
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>
-#include <linux/init.h>
 #include <asm/uaccess.h>
 #include "cpqphp.h"
 #include "cpqphp_nvram.h"
index 8a66866b8cf1ad799de42c2a15075f7549f0ca3a..8e9012dca450df581f718431e25e85d469827534 100644 (file)
@@ -127,7 +127,7 @@ struct controller {
 #define HP_SUPR_RM(ctrl)       ((ctrl)->slot_cap & PCI_EXP_SLTCAP_HPS)
 #define EMI(ctrl)              ((ctrl)->slot_cap & PCI_EXP_SLTCAP_EIP)
 #define NO_CMD_CMPL(ctrl)      ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS)
-#define PSN(ctrl)              ((ctrl)->slot_cap >> 19)
+#define PSN(ctrl)              (((ctrl)->slot_cap & PCI_EXP_SLTCAP_PSN) >> 19)
 
 int pciehp_sysfs_enable_slot(struct slot *slot);
 int pciehp_sysfs_disable_slot(struct slot *slot);
index d7d058fa19a428e5503c919979e5a6e1e5e5e0b2..1463412cf7f8e9b1d63cfc31a6d4a2085de3b21d 100644 (file)
@@ -159,6 +159,8 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
 
        pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
        if (slot_status & PCI_EXP_SLTSTA_CC) {
+               pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
+                                          PCI_EXP_SLTSTA_CC);
                if (!ctrl->no_cmd_complete) {
                        /*
                         * After 1 sec and CMD_COMPLETED still not set, just
index 16f9203523179c46e99505443675c964f16f4b1a..e246a10a0d2c5e4eb729e3d4c822f6dda19f176a 100644 (file)
@@ -160,8 +160,7 @@ void pci_configure_slot(struct pci_dev *dev)
                        (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI)))
                return;
 
-       if (dev->bus)
-               pcie_bus_configure_settings(dev->bus);
+       pcie_bus_configure_settings(dev->bus);
 
        memset(&hpp, 0, sizeof(hpp));
        ret = pci_get_hp_params(dev, &hpp);
index 4796c15fba941df07c4d3bbeed94413d2df48473..984d708552f6f950d000a52ce5d1e9f225f2d728 100644 (file)
@@ -223,16 +223,16 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
        type_tmp = (char *) &types[1];
 
        /* Iterate through parent properties, looking for my-drc-index */
-       for (i = 0; i < indexes[0]; i++) {
+       for (i = 0; i < be32_to_cpu(indexes[0]); i++) {
                if ((unsigned int) indexes[i + 1] == *my_index) {
                        if (drc_name)
                                *drc_name = name_tmp;
                        if (drc_type)
                                *drc_type = type_tmp;
                        if (drc_index)
-                               *drc_index = *my_index;
+                               *drc_index = be32_to_cpu(*my_index);
                        if (drc_power_domain)
-                               *drc_power_domain = domains[i+1];
+                               *drc_power_domain = be32_to_cpu(domains[i+1]);
                        return 0;
                }
                name_tmp += (strlen(name_tmp) + 1);
@@ -321,16 +321,19 @@ int rpaphp_add_slot(struct device_node *dn)
        /* register PCI devices */
        name = (char *) &names[1];
        type = (char *) &types[1];
-       for (i = 0; i < indexes[0]; i++) {
+       for (i = 0; i < be32_to_cpu(indexes[0]); i++) {
+               int index;
 
-               slot = alloc_slot_struct(dn, indexes[i + 1], name, power_domains[i + 1]);
+               index = be32_to_cpu(indexes[i + 1]);
+               slot = alloc_slot_struct(dn, index, name,
+                                        be32_to_cpu(power_domains[i + 1]));
                if (!slot)
                        return -ENOMEM;
 
                slot->type = simple_strtoul(type, NULL, 10);
 
                dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
-                               indexes[i + 1], name, type);
+                               index, name, type);
 
                retval = rpaphp_enable_slot(slot);
                if (!retval)
index 8d2ce22151eb62001e0a2184e1f68da1a606dec5..d1332d2f8730cde2ffc8775f3a8ce46d2d7baaae 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>
-#include <linux/init.h>
 #include <asm/pci_debug.h>
 #include <asm/sclp.h>
 
index 2bf69fe1926c6b503283c43b954779ceaf2ea1d7..18209ebc097961b4c5242f9c6c427dad1497f5bc 100644 (file)
@@ -34,7 +34,7 @@
 #include "../pci.h"
 #include "shpchp.h"
 
-int __ref shpchp_configure_device(struct slot *p_slot)
+int shpchp_configure_device(struct slot *p_slot)
 {
        struct pci_dev *dev;
        struct controller *ctrl = p_slot->ctrl;
index 955ab7990c5bd7045f2bf896e6d4c65989176089..27a7e67ddfe4c53617eea8c506fe96683a3d668d 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/mm.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/init.h>
 #include <linux/export.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
@@ -544,22 +543,18 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
        if (!msi_attrs)
                return -ENOMEM;
        list_for_each_entry(entry, &pdev->msi_list, list) {
-               char *name = kmalloc(20, GFP_KERNEL);
-               if (!name)
-                       goto error_attrs;
-
                msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL);
-               if (!msi_dev_attr) {
-                       kfree(name);
+               if (!msi_dev_attr)
                        goto error_attrs;
-               }
+               msi_attrs[count] = &msi_dev_attr->attr;
 
-               sprintf(name, "%d", entry->irq);
                sysfs_attr_init(&msi_dev_attr->attr);
-               msi_dev_attr->attr.name = name;
+               msi_dev_attr->attr.name = kasprintf(GFP_KERNEL, "%d",
+                                                   entry->irq);
+               if (!msi_dev_attr->attr.name)
+                       goto error_attrs;
                msi_dev_attr->attr.mode = S_IRUGO;
                msi_dev_attr->show = msi_mode_show;
-               msi_attrs[count] = &msi_dev_attr->attr;
                ++count;
        }
 
@@ -883,50 +878,6 @@ int pci_msi_vec_count(struct pci_dev *dev)
 }
 EXPORT_SYMBOL(pci_msi_vec_count);
 
-/**
- * pci_enable_msi_block - configure device's MSI capability structure
- * @dev: device to configure
- * @nvec: number of interrupts to configure
- *
- * Allocate IRQs for a device with the MSI capability.
- * This function returns a negative errno if an error occurs.  If it
- * is unable to allocate the number of interrupts requested, it returns
- * the number of interrupts it might be able to allocate.  If it successfully
- * allocates at least the number of interrupts requested, it returns 0 and
- * updates the @dev's irq member to the lowest new interrupt number; the
- * other interrupt numbers allocated to this device are consecutive.
- */
-int pci_enable_msi_block(struct pci_dev *dev, int nvec)
-{
-       int status, maxvec;
-
-       if (dev->current_state != PCI_D0)
-               return -EINVAL;
-
-       maxvec = pci_msi_vec_count(dev);
-       if (maxvec < 0)
-               return maxvec;
-       if (nvec > maxvec)
-               return maxvec;
-
-       status = pci_msi_check_device(dev, nvec, PCI_CAP_ID_MSI);
-       if (status)
-               return status;
-
-       WARN_ON(!!dev->msi_enabled);
-
-       /* Check whether driver already requested MSI-X irqs */
-       if (dev->msix_enabled) {
-               dev_info(&dev->dev, "can't enable MSI "
-                        "(MSI-X already enabled)\n");
-               return -EINVAL;
-       }
-
-       status = msi_capability_init(dev, nvec);
-       return status;
-}
-EXPORT_SYMBOL(pci_enable_msi_block);
-
 void pci_msi_shutdown(struct pci_dev *dev)
 {
        struct msi_desc *desc;
@@ -1132,14 +1083,45 @@ void pci_msi_init_pci_dev(struct pci_dev *dev)
  **/
 int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec)
 {
-       int nvec = maxvec;
+       int nvec;
        int rc;
 
+       if (dev->current_state != PCI_D0)
+               return -EINVAL;
+
+       WARN_ON(!!dev->msi_enabled);
+
+       /* Check whether driver already requested MSI-X irqs */
+       if (dev->msix_enabled) {
+               dev_info(&dev->dev,
+                        "can't enable MSI (MSI-X already enabled)\n");
+               return -EINVAL;
+       }
+
        if (maxvec < minvec)
                return -ERANGE;
 
+       nvec = pci_msi_vec_count(dev);
+       if (nvec < 0)
+               return nvec;
+       else if (nvec < minvec)
+               return -EINVAL;
+       else if (nvec > maxvec)
+               nvec = maxvec;
+
+       do {
+               rc = pci_msi_check_device(dev, nvec, PCI_CAP_ID_MSI);
+               if (rc < 0) {
+                       return rc;
+               } else if (rc > 0) {
+                       if (rc < minvec)
+                               return -ENOSPC;
+                       nvec = rc;
+               }
+       } while (rc);
+
        do {
-               rc = pci_enable_msi_block(dev, nvec);
+               rc = msi_capability_init(dev, nvec);
                if (rc < 0) {
                        return rc;
                } else if (rc > 0) {
index d911e0c1f359799ef4f110b59b2f68516868d153..ff236ed4f5cf4f6341a9fed1ea206bd865a93141 100644 (file)
@@ -107,7 +107,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
                subdevice=PCI_ANY_ID, class=0, class_mask=0;
        unsigned long driver_data=0;
        int fields=0;
-       int retval;
+       int retval = 0;
 
        fields = sscanf(buf, "%x %x %x %x %x %x %lx",
                        &vendor, &device, &subvendor, &subdevice,
@@ -115,6 +115,26 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
        if (fields < 2)
                return -EINVAL;
 
+       if (fields != 7) {
+               struct pci_dev *pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
+               if (!pdev)
+                       return -ENOMEM;
+
+               pdev->vendor = vendor;
+               pdev->device = device;
+               pdev->subsystem_vendor = subvendor;
+               pdev->subsystem_device = subdevice;
+               pdev->class = class;
+
+               if (pci_match_id(pdrv->id_table, pdev))
+                       retval = -EEXIST;
+
+               kfree(pdev);
+
+               if (retval)
+                       return retval;
+       }
+
        /* Only accept driver_data values that match an existing id_table
           entry */
        if (ids) {
@@ -1325,8 +1345,6 @@ static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
                return -ENODEV;
 
        pdev = to_pci_dev(dev);
-       if (!pdev)
-               return -ENODEV;
 
        if (add_uevent_var(env, "PCI_CLASS=%04X", pdev->class))
                return -ENOMEM;
@@ -1347,6 +1365,7 @@ static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
                           (u8)(pdev->class >> 16), (u8)(pdev->class >> 8),
                           (u8)(pdev->class)))
                return -ENOMEM;
+
        return 0;
 }
 
index 4e0acefb7565d0f3b81013855efa85c86ca5a98e..b7333fa5f80d3d88ec419319a7431f44cf0aed0a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/vgaarb.h>
 #include <linux/pm_runtime.h>
+#include <linux/of.h>
 #include "pci.h"
 
 static int sysfs_initialized;  /* = 0 */
@@ -416,6 +417,20 @@ static ssize_t d3cold_allowed_show(struct device *dev,
 static DEVICE_ATTR_RW(d3cold_allowed);
 #endif
 
+#ifdef CONFIG_OF
+static ssize_t devspec_show(struct device *dev,
+                           struct device_attribute *attr, char *buf)
+{
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct device_node *np = pci_device_to_OF_node(pdev);
+
+       if (np == NULL || np->full_name == NULL)
+               return 0;
+       return sprintf(buf, "%s", np->full_name);
+}
+static DEVICE_ATTR_RO(devspec);
+#endif
+
 #ifdef CONFIG_PCI_IOV
 static ssize_t sriov_totalvfs_show(struct device *dev,
                                   struct device_attribute *attr,
@@ -520,6 +535,9 @@ static struct attribute *pci_dev_attrs[] = {
        &dev_attr_msi_bus.attr,
 #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
        &dev_attr_d3cold_allowed.attr,
+#endif
+#ifdef CONFIG_OF
+       &dev_attr_devspec.attr,
 #endif
        NULL,
 };
@@ -1255,11 +1273,6 @@ static struct bin_attribute pcie_config_attr = {
        .write = pci_write_config,
 };
 
-int __weak pcibios_add_platform_entries(struct pci_dev *dev)
-{
-       return 0;
-}
-
 static ssize_t reset_store(struct device *dev,
                           struct device_attribute *attr, const char *buf,
                           size_t count)
@@ -1375,11 +1388,6 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
                pdev->rom_attr = attr;
        }
 
-       /* add platform-specific attributes */
-       retval = pcibios_add_platform_entries(pdev);
-       if (retval)
-               goto err_rom_file;
-
        /* add sysfs entries for various capabilities */
        retval = pci_create_capabilities_sysfs(pdev);
        if (retval)
index 7325d43bf030ce65d5f386f6aeeeb3bfa4d5c482..39012831867e619be58b27e9becaa472ea6dd73c 100644 (file)
@@ -4125,7 +4125,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
        u16 cmd;
        int rc;
 
-       WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) & (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
+       WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) && (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
 
        /* ARCH specific VGA enables */
        rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);
index 6bd082299e3190b5676e49d781231f49e5eaa3fc..fe233a3099cf60fba08d894140ad5b25ace9d188 100644 (file)
@@ -201,11 +201,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
                    struct resource *res, unsigned int reg);
 int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type);
 void pci_configure_ari(struct pci_dev *dev);
-void __ref __pci_bus_size_bridges(struct pci_bus *bus,
+void __pci_bus_size_bridges(struct pci_bus *bus,
                        struct list_head *realloc_head);
-void __ref __pci_bus_assign_resources(const struct pci_bus *bus,
-                                     struct list_head *realloc_head,
-                                     struct list_head *fail_head);
+void __pci_bus_assign_resources(const struct pci_bus *bus,
+                               struct list_head *realloc_head,
+                               struct list_head *fail_head);
 
 /**
  * pci_ari_enabled - query ARI forwarding status
index 986f8eadfd39397aff7d38c71452d86b3e6fa530..2f0ce668a775eda0ccc15ea6bbfeea133ac6c823 100644 (file)
@@ -99,7 +99,7 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
        for (i = 0; i < nr_entries; i++)
                msix_entries[i].entry = i;
 
-       status = pci_enable_msix(dev, msix_entries, nr_entries);
+       status = pci_enable_msix_exact(dev, msix_entries, nr_entries);
        if (status)
                goto Exit;
 
@@ -171,7 +171,7 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
                pci_disable_msix(dev);
 
                /* Now allocate the MSI-X vectors for real */
-               status = pci_enable_msix(dev, msix_entries, nvec);
+               status = pci_enable_msix_exact(dev, msix_entries, nvec);
                if (status)
                        goto Exit;
        }
@@ -379,10 +379,13 @@ int pcie_port_device_register(struct pci_dev *dev)
        /*
         * Initialize service irqs. Don't use service devices that
         * require interrupts if there is no way to generate them.
+        * However, some drivers may have a polling mode (e.g. pciehp_poll_mode)
+        * that can be used in the absence of irqs.  Allow them to determine
+        * if that is to be used.
         */
        status = init_service_irqs(dev, irqs, capabilities);
        if (status) {
-               capabilities &= PCIE_PORT_SERVICE_VC;
+               capabilities &= PCIE_PORT_SERVICE_VC | PCIE_PORT_SERVICE_HP;
                if (!capabilities)
                        goto error_disable;
        }
index ef09f5f2fe6c0bc7f0ba84ae06eaa9d46adea4e6..52d05e054cd8473b1298b90bdd6cfa3321efc33d 100644 (file)
@@ -171,9 +171,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
                        struct resource *res, unsigned int pos)
 {
        u32 l, sz, mask;
+       u64 l64, sz64, mask64;
        u16 orig_cmd;
        struct pci_bus_region region, inverted_region;
-       bool bar_too_big = false, bar_disabled = false;
+       bool bar_too_big = false, bar_too_high = false, bar_invalid = false;
 
        mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
 
@@ -226,9 +227,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
        }
 
        if (res->flags & IORESOURCE_MEM_64) {
-               u64 l64 = l;
-               u64 sz64 = sz;
-               u64 mask64 = mask | (u64)~0 << 32;
+               l64 = l;
+               sz64 = sz;
+               mask64 = mask | (u64)~0 << 32;
 
                pci_read_config_dword(dev, pos + 4, &l);
                pci_write_config_dword(dev, pos + 4, ~0);
@@ -243,19 +244,22 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
                if (!sz64)
                        goto fail;
 
-               if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) {
+               if ((sizeof(dma_addr_t) < 8 || sizeof(resource_size_t) < 8) &&
+                   sz64 > 0x100000000ULL) {
+                       res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
+                       res->start = 0;
+                       res->end = 0;
                        bar_too_big = true;
-                       goto fail;
+                       goto out;
                }
 
-               if ((sizeof(resource_size_t) < 8) && l) {
-                       /* Address above 32-bit boundary; disable the BAR */
-                       pci_write_config_dword(dev, pos, 0);
-                       pci_write_config_dword(dev, pos + 4, 0);
+               if ((sizeof(dma_addr_t) < 8) && l) {
+                       /* Above 32-bit boundary; try to reallocate */
                        res->flags |= IORESOURCE_UNSET;
-                       region.start = 0;
-                       region.end = sz64;
-                       bar_disabled = true;
+                       res->start = 0;
+                       res->end = sz64;
+                       bar_too_high = true;
+                       goto out;
                } else {
                        region.start = l64;
                        region.end = l64 + sz64;
@@ -285,11 +289,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
         * be claimed by the device.
         */
        if (inverted_region.start != region.start) {
-               dev_info(&dev->dev, "reg 0x%x: initial BAR value %pa invalid; forcing reassignment\n",
-                        pos, &region.start);
                res->flags |= IORESOURCE_UNSET;
-               res->end -= res->start;
                res->start = 0;
+               res->end = region.end - region.start;
+               bar_invalid = true;
        }
 
        goto out;
@@ -303,8 +306,15 @@ out:
                pci_write_config_word(dev, PCI_COMMAND, orig_cmd);
 
        if (bar_too_big)
-               dev_err(&dev->dev, "reg 0x%x: can't handle 64-bit BAR\n", pos);
-       if (res->flags && !bar_disabled)
+               dev_err(&dev->dev, "reg 0x%x: can't handle BAR larger than 4GB (size %#010llx)\n",
+                       pos, (unsigned long long) sz64);
+       if (bar_too_high)
+               dev_info(&dev->dev, "reg 0x%x: can't handle BAR above 4G (bus address %#010llx)\n",
+                        pos, (unsigned long long) l64);
+       if (bar_invalid)
+               dev_info(&dev->dev, "reg 0x%x: initial BAR value %#010llx invalid\n",
+                        pos, (unsigned long long) region.start);
+       if (res->flags)
                dev_printk(KERN_DEBUG, &dev->dev, "reg 0x%x: %pR\n", pos, res);
 
        return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
@@ -465,7 +475,7 @@ void pci_read_bridge_bases(struct pci_bus *child)
 
        if (dev->transparent) {
                pci_bus_for_each_resource(child->parent, res, i) {
-                       if (res) {
+                       if (res && res->flags) {
                                pci_bus_add_resource(child, res,
                                                     PCI_SUBTRACTIVE_DECODE);
                                dev_printk(KERN_DEBUG, &dev->dev,
@@ -719,7 +729,7 @@ add_dev:
        return child;
 }
 
-struct pci_bus *__ref pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
+struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
 {
        struct pci_bus *child;
 
@@ -1369,7 +1379,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
        WARN_ON(ret < 0);
 }
 
-struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
+struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn)
 {
        struct pci_dev *dev;
 
@@ -1617,7 +1627,7 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data)
  */
 void pcie_bus_configure_settings(struct pci_bus *bus)
 {
-       u8 smpss;
+       u8 smpss = 0;
 
        if (!bus->self)
                return;
@@ -1958,7 +1968,7 @@ EXPORT_SYMBOL(pci_scan_bus);
  *
  * Returns the max number of subordinate bus discovered.
  */
-unsigned int __ref pci_rescan_bus_bridge_resize(struct pci_dev *bridge)
+unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge)
 {
        unsigned int max;
        struct pci_bus *bus = bridge->subordinate;
@@ -1981,7 +1991,7 @@ unsigned int __ref pci_rescan_bus_bridge_resize(struct pci_dev *bridge)
  *
  * Returns the max number of subordinate bus discovered.
  */
-unsigned int __ref pci_rescan_bus(struct pci_bus *bus)
+unsigned int pci_rescan_bus(struct pci_bus *bus)
 {
        unsigned int max;
 
index e7292065a1b13f3281eaebde605db8c2eb556145..92e68c7747f7dedfd43ec15e551bd6ab7c9b0c92 100644 (file)
@@ -2954,6 +2954,7 @@ static void disable_igfx_irq(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
 
 /*
  * PCI devices which are on Intel chips can skip the 10ms delay
@@ -2991,6 +2992,14 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CHELSIO, 0x0030,
                         quirk_broken_intx_masking);
 DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, /* Ralink RT2800 802.11n PCI */
                         quirk_broken_intx_masking);
+/*
+ * Realtek RTL8169 PCI Gigabit Ethernet Controller (rev 10)
+ * Subsystem: Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC
+ *
+ * RTL8110SC - Fails under PCI device assignment using DisINTx masking.
+ */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x8169,
+                        quirk_broken_intx_masking);
 
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
                          struct pci_fixup *end)
@@ -3453,6 +3462,8 @@ static const u16 pci_quirk_intel_pch_acs_ids[] = {
        /* Wildcat PCH */
        0x9c90, 0x9c91, 0x9c92, 0x9c93, 0x9c94, 0x9c95, 0x9c96, 0x9c97,
        0x9c98, 0x9c99, 0x9c9a, 0x9c9b,
+       /* Patsburg (X79) PCH */
+       0x1d10, 0x1d12, 0x1d14, 0x1d16, 0x1d18, 0x1d1a, 0x1d1c, 0x1d1e,
 };
 
 static bool pci_quirk_intel_pch_acs_match(struct pci_dev *dev)
index 4a1b972efe7f2fbb76c33467de665a16004fda37..8e495bda678f2e0e9a927ac993c27da8f585e37a 100644 (file)
@@ -7,7 +7,6 @@
  *     Copyright (C) 2003 -- 2004 Greg Kroah-Hartman <greg@kroah.com>
  */
 
-#include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/module.h>
index 138bdd6393be87b2ebc63ba35b1b4edaa228b8ad..d9fdcea4412a927382cff551b448928e5691a89d 100644 (file)
@@ -713,12 +713,11 @@ static void pci_bridge_check_ranges(struct pci_bus *bus)
    bus resource of a given type. Note: we intentionally skip
    the bus resources which have already been assigned (that is,
    have non-NULL parent resource). */
-static struct resource *find_free_bus_resource(struct pci_bus *bus, unsigned long type)
+static struct resource *find_free_bus_resource(struct pci_bus *bus,
+                        unsigned long type_mask, unsigned long type)
 {
        int i;
        struct resource *r;
-       unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
-                                 IORESOURCE_PREFETCH;
 
        pci_bus_for_each_resource(bus, r, i) {
                if (r == &ioport_resource || r == &iomem_resource)
@@ -815,7 +814,8 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
                resource_size_t add_size, struct list_head *realloc_head)
 {
        struct pci_dev *dev;
-       struct resource *b_res = find_free_bus_resource(bus, IORESOURCE_IO);
+       struct resource *b_res = find_free_bus_resource(bus, IORESOURCE_IO,
+                                                       IORESOURCE_IO);
        resource_size_t size = 0, size0 = 0, size1 = 0;
        resource_size_t children_add_size = 0;
        resource_size_t min_align, align;
@@ -907,36 +907,40 @@ static inline resource_size_t calculate_mem_align(resource_size_t *aligns,
  * @bus : the bus
  * @mask: mask the resource flag, then compare it with type
  * @type: the type of free resource from bridge
+ * @type2: second match type
+ * @type3: third match type
  * @min_size : the minimum memory window that must to be allocated
  * @add_size : additional optional memory window
  * @realloc_head : track the additional memory window on this list
  *
  * Calculate the size of the bus and minimal alignment which
  * guarantees that all child resources fit in this size.
+ *
+ * Returns -ENOSPC if there's no available bus resource of the desired type.
+ * Otherwise, sets the bus resource start/end to indicate the required
+ * size, adds things to realloc_head (if supplied), and returns 0.
  */
 static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
-                        unsigned long type, resource_size_t min_size,
-                       resource_size_t add_size,
-                       struct list_head *realloc_head)
+                        unsigned long type, unsigned long type2,
+                        unsigned long type3,
+                        resource_size_t min_size, resource_size_t add_size,
+                        struct list_head *realloc_head)
 {
        struct pci_dev *dev;
        resource_size_t min_align, align, size, size0, size1;
-       resource_size_t aligns[12];     /* Alignments from 1Mb to 2Gb */
+       resource_size_t aligns[14];     /* Alignments from 1Mb to 8Gb */
        int order, max_order;
-       struct resource *b_res = find_free_bus_resource(bus, type);
-       unsigned int mem64_mask = 0;
+       struct resource *b_res = find_free_bus_resource(bus,
+                                       mask | IORESOURCE_PREFETCH, type);
        resource_size_t children_add_size = 0;
 
        if (!b_res)
-               return 0;
+               return -ENOSPC;
 
        memset(aligns, 0, sizeof(aligns));
        max_order = 0;
        size = 0;
 
-       mem64_mask = b_res->flags & IORESOURCE_MEM_64;
-       b_res->flags &= ~IORESOURCE_MEM_64;
-
        list_for_each_entry(dev, &bus->devices, bus_list) {
                int i;
 
@@ -944,7 +948,9 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
                        struct resource *r = &dev->resource[i];
                        resource_size_t r_size;
 
-                       if (r->parent || (r->flags & mask) != type)
+                       if (r->parent || ((r->flags & mask) != type &&
+                                         (r->flags & mask) != type2 &&
+                                         (r->flags & mask) != type3))
                                continue;
                        r_size = resource_size(r);
 #ifdef CONFIG_PCI_IOV
@@ -957,10 +963,17 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
                                continue;
                        }
 #endif
-                       /* For bridges size != alignment */
+                       /*
+                        * aligns[0] is for 1MB (since bridge memory
+                        * windows are always at least 1MB aligned), so
+                        * keep "order" from being negative for smaller
+                        * resources.
+                        */
                        align = pci_resource_alignment(dev, r);
                        order = __ffs(align) - 20;
-                       if (order > 11) {
+                       if (order < 0)
+                               order = 0;
+                       if (order >= ARRAY_SIZE(aligns)) {
                                dev_warn(&dev->dev, "disabling BAR %d: %pR "
                                         "(bad alignment %#llx)\n", i, r,
                                         (unsigned long long) align);
@@ -968,15 +981,12 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
                                continue;
                        }
                        size += r_size;
-                       if (order < 0)
-                               order = 0;
                        /* Exclude ranges with size > align from
                           calculation of the alignment. */
                        if (r_size == align)
                                aligns[order] += align;
                        if (order > max_order)
                                max_order = order;
-                       mem64_mask &= r->flags & IORESOURCE_MEM_64;
 
                        if (realloc_head)
                                children_add_size += get_res_add_size(realloc_head, r);
@@ -997,18 +1007,18 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
                                 "%pR to %pR (unused)\n", b_res,
                                 &bus->busn_res);
                b_res->flags = 0;
-               return 1;
+               return 0;
        }
        b_res->start = min_align;
        b_res->end = size0 + min_align - 1;
-       b_res->flags |= IORESOURCE_STARTALIGN | mem64_mask;
+       b_res->flags |= IORESOURCE_STARTALIGN;
        if (size1 > size0 && realloc_head) {
                add_to_list(realloc_head, bus->self, b_res, size1-size0, min_align);
                dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "
                                 "%pR to %pR add_size %llx\n", b_res,
                                 &bus->busn_res, (unsigned long long)size1-size0);
        }
-       return 1;
+       return 0;
 }
 
 unsigned long pci_cardbus_resource_alignment(struct resource *res)
@@ -1113,12 +1123,13 @@ handle_done:
        ;
 }
 
-void __ref __pci_bus_size_bridges(struct pci_bus *bus,
-                       struct list_head *realloc_head)
+void __pci_bus_size_bridges(struct pci_bus *bus, struct list_head *realloc_head)
 {
        struct pci_dev *dev;
-       unsigned long mask, prefmask;
+       unsigned long mask, prefmask, type2 = 0, type3 = 0;
        resource_size_t additional_mem_size = 0, additional_io_size = 0;
+       struct resource *b_res;
+       int ret;
 
        list_for_each_entry(dev, &bus->devices, bus_list) {
                struct pci_bus *b = dev->subordinate;
@@ -1152,41 +1163,93 @@ void __ref __pci_bus_size_bridges(struct pci_bus *bus,
                        additional_io_size  = pci_hotplug_io_size;
                        additional_mem_size = pci_hotplug_mem_size;
                }
-               /*
-                * Follow thru
-                */
+               /* Fall through */
        default:
                pbus_size_io(bus, realloc_head ? 0 : additional_io_size,
                             additional_io_size, realloc_head);
-               /* If the bridge supports prefetchable range, size it
-                  separately. If it doesn't, or its prefetchable window
-                  has already been allocated by arch code, try
-                  non-prefetchable range for both types of PCI memory
-                  resources. */
+
+               /*
+                * If there's a 64-bit prefetchable MMIO window, compute
+                * the size required to put all 64-bit prefetchable
+                * resources in it.
+                */
+               b_res = &bus->self->resource[PCI_BRIDGE_RESOURCES];
                mask = IORESOURCE_MEM;
                prefmask = IORESOURCE_MEM | IORESOURCE_PREFETCH;
-               if (pbus_size_mem(bus, prefmask, prefmask,
+               if (b_res[2].flags & IORESOURCE_MEM_64) {
+                       prefmask |= IORESOURCE_MEM_64;
+                       ret = pbus_size_mem(bus, prefmask, prefmask,
+                                 prefmask, prefmask,
                                  realloc_head ? 0 : additional_mem_size,
-                                 additional_mem_size, realloc_head))
-                       mask = prefmask; /* Success, size non-prefetch only. */
-               else
-                       additional_mem_size += additional_mem_size;
-               pbus_size_mem(bus, mask, IORESOURCE_MEM,
+                                 additional_mem_size, realloc_head);
+
+                       /*
+                        * If successful, all non-prefetchable resources
+                        * and any 32-bit prefetchable resources will go in
+                        * the non-prefetchable window.
+                        */
+                       if (ret == 0) {
+                               mask = prefmask;
+                               type2 = prefmask & ~IORESOURCE_MEM_64;
+                               type3 = prefmask & ~IORESOURCE_PREFETCH;
+                       }
+               }
+
+               /*
+                * If there is no 64-bit prefetchable window, compute the
+                * size required to put all prefetchable resources in the
+                * 32-bit prefetchable window (if there is one).
+                */
+               if (!type2) {
+                       prefmask &= ~IORESOURCE_MEM_64;
+                       ret = pbus_size_mem(bus, prefmask, prefmask,
+                                        prefmask, prefmask,
+                                        realloc_head ? 0 : additional_mem_size,
+                                        additional_mem_size, realloc_head);
+
+                       /*
+                        * If successful, only non-prefetchable resources
+                        * will go in the non-prefetchable window.
+                        */
+                       if (ret == 0)
+                               mask = prefmask;
+                       else
+                               additional_mem_size += additional_mem_size;
+
+                       type2 = type3 = IORESOURCE_MEM;
+               }
+
+               /*
+                * Compute the size required to put everything else in the
+                * non-prefetchable window.  This includes:
+                *
+                *   - all non-prefetchable resources
+                *   - 32-bit prefetchable resources if there's a 64-bit
+                *     prefetchable window or no prefetchable window at all
+                *   - 64-bit prefetchable resources if there's no
+                *     prefetchable window at all
+                *
+                * Note that the strategy in __pci_assign_resource() must
+                * match that used here.  Specifically, we cannot put a
+                * 32-bit prefetchable resource in a 64-bit prefetchable
+                * window.
+                */
+               pbus_size_mem(bus, mask, IORESOURCE_MEM, type2, type3,
                                realloc_head ? 0 : additional_mem_size,
                                additional_mem_size, realloc_head);
                break;
        }
 }
 
-void __ref pci_bus_size_bridges(struct pci_bus *bus)
+void pci_bus_size_bridges(struct pci_bus *bus)
 {
        __pci_bus_size_bridges(bus, NULL);
 }
 EXPORT_SYMBOL(pci_bus_size_bridges);
 
-void __ref __pci_bus_assign_resources(const struct pci_bus *bus,
-                                     struct list_head *realloc_head,
-                                     struct list_head *fail_head)
+void __pci_bus_assign_resources(const struct pci_bus *bus,
+                               struct list_head *realloc_head,
+                               struct list_head *fail_head)
 {
        struct pci_bus *b;
        struct pci_dev *dev;
@@ -1218,15 +1281,15 @@ void __ref __pci_bus_assign_resources(const struct pci_bus *bus,
        }
 }
 
-void __ref pci_bus_assign_resources(const struct pci_bus *bus)
+void pci_bus_assign_resources(const struct pci_bus *bus)
 {
        __pci_bus_assign_resources(bus, NULL, NULL);
 }
 EXPORT_SYMBOL(pci_bus_assign_resources);
 
-static void __ref __pci_bridge_assign_resources(const struct pci_dev *bridge,
-                                        struct list_head *add_head,
-                                        struct list_head *fail_head)
+static void __pci_bridge_assign_resources(const struct pci_dev *bridge,
+                                         struct list_head *add_head,
+                                         struct list_head *fail_head)
 {
        struct pci_bus *b;
 
@@ -1257,42 +1320,66 @@ static void __ref __pci_bridge_assign_resources(const struct pci_dev *bridge,
 static void pci_bridge_release_resources(struct pci_bus *bus,
                                          unsigned long type)
 {
-       int idx;
-       bool changed = false;
-       struct pci_dev *dev;
+       struct pci_dev *dev = bus->self;
        struct resource *r;
        unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
-                                 IORESOURCE_PREFETCH;
+                                 IORESOURCE_PREFETCH | IORESOURCE_MEM_64;
+       unsigned old_flags = 0;
+       struct resource *b_res;
+       int idx = 1;
 
-       dev = bus->self;
-       for (idx = PCI_BRIDGE_RESOURCES; idx <= PCI_BRIDGE_RESOURCE_END;
-            idx++) {
-               r = &dev->resource[idx];
-               if ((r->flags & type_mask) != type)
-                       continue;
-               if (!r->parent)
-                       continue;
-               /*
-                * if there are children under that, we should release them
-                *  all
-                */
-               release_child_resources(r);
-               if (!release_resource(r)) {
-                       dev_printk(KERN_DEBUG, &dev->dev,
-                                "resource %d %pR released\n", idx, r);
-                       /* keep the old size */
-                       r->end = resource_size(r) - 1;
-                       r->start = 0;
-                       r->flags = 0;
-                       changed = true;
-               }
-       }
+       b_res = &dev->resource[PCI_BRIDGE_RESOURCES];
+
+       /*
+        *     1. if there is io port assign fail, will release bridge
+        *        io port.
+        *     2. if there is non pref mmio assign fail, release bridge
+        *        nonpref mmio.
+        *     3. if there is 64bit pref mmio assign fail, and bridge pref
+        *        is 64bit, release bridge pref mmio.
+        *     4. if there is pref mmio assign fail, and bridge pref is
+        *        32bit mmio, release bridge pref mmio
+        *     5. if there is pref mmio assign fail, and bridge pref is not
+        *        assigned, release bridge nonpref mmio.
+        */
+       if (type & IORESOURCE_IO)
+               idx = 0;
+       else if (!(type & IORESOURCE_PREFETCH))
+               idx = 1;
+       else if ((type & IORESOURCE_MEM_64) &&
+                (b_res[2].flags & IORESOURCE_MEM_64))
+               idx = 2;
+       else if (!(b_res[2].flags & IORESOURCE_MEM_64) &&
+                (b_res[2].flags & IORESOURCE_PREFETCH))
+               idx = 2;
+       else
+               idx = 1;
+
+       r = &b_res[idx];
+
+       if (!r->parent)
+               return;
+
+       /*
+        * if there are children under that, we should release them
+        *  all
+        */
+       release_child_resources(r);
+       if (!release_resource(r)) {
+               type = old_flags = r->flags & type_mask;
+               dev_printk(KERN_DEBUG, &dev->dev, "resource %d %pR released\n",
+                                       PCI_BRIDGE_RESOURCES + idx, r);
+               /* keep the old size */
+               r->end = resource_size(r) - 1;
+               r->start = 0;
+               r->flags = 0;
 
-       if (changed) {
                /* avoiding touch the one without PREF */
                if (type & IORESOURCE_PREFETCH)
                        type = IORESOURCE_PREFETCH;
                __pci_setup_bridge(bus, type);
+               /* for next child res under same bridge */
+               r->flags = old_flags;
        }
 }
 
@@ -1304,9 +1391,9 @@ enum release_type {
  * try to release pci bridge resources that is from leaf bridge,
  * so we can allocate big new one later
  */
-static void __ref pci_bus_release_bridge_resources(struct pci_bus *bus,
-                                                  unsigned long type,
-                                                  enum release_type rel_type)
+static void pci_bus_release_bridge_resources(struct pci_bus *bus,
+                                            unsigned long type,
+                                            enum release_type rel_type)
 {
        struct pci_dev *dev;
        bool is_leaf_bridge = true;
@@ -1471,7 +1558,7 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
        LIST_HEAD(fail_head);
        struct pci_dev_resource *fail_res;
        unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
-                                 IORESOURCE_PREFETCH;
+                                 IORESOURCE_PREFETCH | IORESOURCE_MEM_64;
        int pci_try_num = 1;
        enum enable_type enable_local;
 
index 9bd6864ec5d3fc3b6e18e2505f884a6dc8f94166..dbc4ffcf42decd31fbc2fd595cfc3bbbb08a9196 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/errno.h>
index 7eed671d55861c4ef890b33a68cfbaa2d7ef47e0..33f9e32d94d0cba92fbb2c339cb06f6df8106a52 100644 (file)
@@ -16,7 +16,6 @@
  *          Resource sorting
  */
 
-#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/export.h>
 #include <linux/pci.h>
@@ -209,21 +208,42 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
 
        min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
 
-       /* First, try exact prefetching match.. */
+       /*
+        * First, try exact prefetching match.  Even if a 64-bit
+        * prefetchable bridge window is below 4GB, we can't put a 32-bit
+        * prefetchable resource in it because pbus_size_mem() assumes a
+        * 64-bit window will contain no 32-bit resources.  If we assign
+        * things differently than they were sized, not everything will fit.
+        */
        ret = pci_bus_alloc_resource(bus, res, size, align, min,
-                                    IORESOURCE_PREFETCH,
+                                    IORESOURCE_PREFETCH | IORESOURCE_MEM_64,
                                     pcibios_align_resource, dev);
+       if (ret == 0)
+               return 0;
 
-       if (ret < 0 && (res->flags & IORESOURCE_PREFETCH)) {
-               /*
-                * That failed.
-                *
-                * But a prefetching area can handle a non-prefetching
-                * window (it will just not perform as well).
-                */
-               ret = pci_bus_alloc_resource(bus, res, size, align, min, 0,
+       /*
+        * If the prefetchable window is only 32 bits wide, we can put
+        * 64-bit prefetchable resources in it.
+        */
+       if ((res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) ==
+            (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) {
+               ret = pci_bus_alloc_resource(bus, res, size, align, min,
+                                            IORESOURCE_PREFETCH,
                                             pcibios_align_resource, dev);
+               if (ret == 0)
+                       return 0;
        }
+
+       /*
+        * If we didn't find a better match, we can put any memory resource
+        * in a non-prefetchable window.  If this resource is 32 bits and
+        * non-prefetchable, the first call already tried the only possibility
+        * so we don't need to try again.
+        */
+       if (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64))
+               ret = pci_bus_alloc_resource(bus, res, size, align, min, 0,
+                                            pcibios_align_resource, dev);
+
        return ret;
 }
 
index aab57b4abe7fce4ef59adc14db6400d3a6af57cc..5dbd15422b559fce30f8ce6f21b8c21e1cdb823e 100644 (file)
@@ -680,8 +680,8 @@ struct pci_driver {
 
 /**
  * PCI_VDEVICE - macro used to describe a specific pci device in short form
- * @vendor: the vendor name
- * @device: the 16 bit PCI Device ID
+ * @vend: the vendor name
+ * @dev: the 16 bit PCI Device ID
  *
  * This macro is used to create a struct pci_device_id that matches a
  * specific PCI device.  The subvendor, and subdevice fields will be set
@@ -689,9 +689,9 @@ struct pci_driver {
  * private data.
  */
 
-#define PCI_VDEVICE(vendor, device)            \
-       PCI_VENDOR_ID_##vendor, (device),       \
-       PCI_ANY_ID, PCI_ANY_ID, 0, 0
+#define PCI_VDEVICE(vend, dev) \
+       .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
+       .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
 
 /* these external functions are only available when PCI support is enabled */
 #ifdef CONFIG_PCI
@@ -1158,7 +1158,6 @@ struct msix_entry {
 
 #ifdef CONFIG_PCI_MSI
 int pci_msi_vec_count(struct pci_dev *dev);
-int pci_enable_msi_block(struct pci_dev *dev, int nvec);
 void pci_msi_shutdown(struct pci_dev *dev);
 void pci_disable_msi(struct pci_dev *dev);
 int pci_msix_vec_count(struct pci_dev *dev);
@@ -1188,8 +1187,6 @@ static inline int pci_enable_msix_exact(struct pci_dev *dev,
 }
 #else
 static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
-static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec)
-{ return -ENOSYS; }
 static inline void pci_msi_shutdown(struct pci_dev *dev) { }
 static inline void pci_disable_msi(struct pci_dev *dev) { }
 static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; }
@@ -1244,7 +1241,7 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
 static inline void pcie_ecrc_get_policy(char *str) { }
 #endif
 
-#define pci_enable_msi(pdev)   pci_enable_msi_block(pdev, 1)
+#define pci_enable_msi(pdev)   pci_enable_msi_exact(pdev, 1)
 
 #ifdef CONFIG_HT_IRQ
 /* The functions a driver should call */
@@ -1572,7 +1569,6 @@ extern unsigned long pci_hotplug_io_size;
 extern unsigned long pci_hotplug_mem_size;
 
 /* Architecture-specific versions may override these (weak) */
-int pcibios_add_platform_entries(struct pci_dev *dev);
 void pcibios_disable_device(struct pci_dev *dev);
 void pcibios_set_master(struct pci_dev *dev);
 int pcibios_set_pcie_reset_state(struct pci_dev *dev,
index d4de24b4d4c64a184ff4270e2c0755f4ff59b4d6..7fa31731c8548e82f354df86571ee1189cec5f95 100644 (file)
 #define PCI_DEVICE_ID_ATT_VENUS_MODEM  0x480
 
 #define PCI_VENDOR_ID_SPECIALIX                0x11cb
-#define PCI_DEVICE_ID_SPECIALIX_IO8    0x2000
-#define PCI_DEVICE_ID_SPECIALIX_RIO    0x8000
 #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
 
 #define PCI_VENDOR_ID_ANALOG_DEVICES   0x11d4
 #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
 
 #define PCI_VENDOR_ID_COMPUTONE                0x8e0e
-#define PCI_DEVICE_ID_COMPUTONE_IP2EX  0x0291
 #define PCI_DEVICE_ID_COMPUTONE_PG     0x0302
 #define PCI_SUBVENDOR_ID_COMPUTONE     0x8e0e
 #define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001
index 8957d686e29ba94c49f2a67f9fab5ddcdfd3a050..3c2237ac32dbedf56d10444a7feef59e6b35a561 100644 (file)
@@ -1288,13 +1288,10 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
                if (p->flags & IORESOURCE_BUSY)
                        continue;
 
-               printk(KERN_WARNING "resource map sanity check conflict: "
-                      "0x%llx 0x%llx 0x%llx 0x%llx %s\n",
+               printk(KERN_WARNING "resource sanity check: requesting [mem %#010llx-%#010llx], which spans more than %s %pR\n",
                       (unsigned long long)addr,
                       (unsigned long long)(addr + size - 1),
-                      (unsigned long long)p->start,
-                      (unsigned long long)p->end,
-                      p->name);
+                      p->name, p);
                err = -1;
                break;
        }