aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-04-22 20:08:44 -0400
committerJiri Kosina <jkosina@suse.cz>2010-04-22 20:08:44 -0400
commit6c9468e9eb1252eaefd94ce7f06e1be9b0b641b1 (patch)
tree797676a336b050bfa1ef879377c07e541b9075d6 /drivers/pci
parent4cb3ca7cd7e2cae8d1daf5345ec99a1e8502cf3f (diff)
parentc81eddb0e3728661d1585fbc564449c94165cc36 (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/Makefile1
-rw-r--r--drivers/pci/access.c1
-rw-r--r--drivers/pci/bus.c1
-rw-r--r--drivers/pci/dmar.c1
-rw-r--r--drivers/pci/hotplug/acpi_pcihp.c1
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c20
-rw-r--r--drivers/pci/hotplug/acpiphp_ibm.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c1
-rw-r--r--drivers/pci/hotplug/fakephp.c1
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c1
-rw-r--r--drivers/pci/hotplug/pciehp_acpi.c1
-rw-r--r--drivers/pci/hotplug/pciehp_core.c1
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c1
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c6
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c1
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c1
-rw-r--r--drivers/pci/hotplug/shpchp_core.c1
-rw-r--r--drivers/pci/hotplug/shpchp_ctrl.c1
-rw-r--r--drivers/pci/htirq.c1
-rw-r--r--drivers/pci/intr_remapping.c1
-rw-r--r--drivers/pci/ioapic.c10
-rw-r--r--drivers/pci/iov.c1
-rw-r--r--drivers/pci/msi.c1
-rw-r--r--drivers/pci/pci-sysfs.c3
-rw-r--r--drivers/pci/pci.c45
-rw-r--r--drivers/pci/pcie/aer/aer_inject.c1
-rw-r--r--drivers/pci/pcie/aer/aerdrv.c1
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c1
-rw-r--r--drivers/pci/pcie/pme/pcie_pme.c1
-rw-r--r--drivers/pci/pcie/portdrv_pci.c1
-rw-r--r--drivers/pci/probe.c53
-rw-r--r--drivers/pci/proc.c1
-rw-r--r--drivers/pci/quirks.c29
-rw-r--r--drivers/pci/search.c1
-rw-r--r--drivers/pci/setup-res.c14
-rw-r--r--drivers/pci/slot.c1
36 files changed, 140 insertions, 68 deletions
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 3d102dd87c9f..0b51857fbaf7 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_PPC) += setup-bus.o
48obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o 48obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
49obj-$(CONFIG_X86_VISWS) += setup-irq.o 49obj-$(CONFIG_X86_VISWS) += setup-irq.o
50obj-$(CONFIG_MN10300) += setup-bus.o 50obj-$(CONFIG_MN10300) += setup-bus.o
51obj-$(CONFIG_MICROBLAZE) += setup-bus.o
51 52
52# 53#
53# ACPI Related PCI FW Functions 54# ACPI Related PCI FW Functions
diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index db23200c4874..2f646fe1260f 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -2,6 +2,7 @@
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include <linux/module.h> 3#include <linux/module.h>
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/slab.h>
5#include <linux/ioport.h> 6#include <linux/ioport.h>
6#include <linux/wait.h> 7#include <linux/wait.h>
7 8
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 26301cb25e7f..628ea20a8841 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -14,6 +14,7 @@
14#include <linux/ioport.h> 14#include <linux/ioport.h>
15#include <linux/proc_fs.h> 15#include <linux/proc_fs.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/slab.h>
17 18
18#include "pci.h" 19#include "pci.h"
19 20
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 83aae4747594..33ead97f0c4b 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -35,6 +35,7 @@
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/tboot.h> 36#include <linux/tboot.h>
37#include <linux/dmi.h> 37#include <linux/dmi.h>
38#include <linux/slab.h>
38 39
39#define PREFIX "DMAR: " 40#define PREFIX "DMAR: "
40 41
diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c
index 3c76fc67cf0e..45fcc1e96df9 100644
--- a/drivers/pci/hotplug/acpi_pcihp.c
+++ b/drivers/pci/hotplug/acpi_pcihp.c
@@ -32,6 +32,7 @@
32#include <linux/pci_hotplug.h> 32#include <linux/pci_hotplug.h>
33#include <linux/acpi.h> 33#include <linux/acpi.h>
34#include <linux/pci-acpi.h> 34#include <linux/pci-acpi.h>
35#include <linux/slab.h>
35 36
36#define MY_NAME "acpi_pcihp" 37#define MY_NAME "acpi_pcihp"
37 38
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cb2fd01eddae..cb23aa2ebf96 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -47,6 +47,7 @@
47#include <linux/pci_hotplug.h> 47#include <linux/pci_hotplug.h>
48#include <linux/pci-acpi.h> 48#include <linux/pci-acpi.h>
49#include <linux/mutex.h> 49#include <linux/mutex.h>
50#include <linux/slab.h>
50 51
51#include "../pci.h" 52#include "../pci.h"
52#include "acpiphp.h" 53#include "acpiphp.h"
@@ -749,6 +750,24 @@ static int acpiphp_bus_trim(acpi_handle handle)
749 return retval; 750 return retval;
750} 751}
751 752
753static void acpiphp_set_acpi_region(struct acpiphp_slot *slot)
754{
755 struct acpiphp_func *func;
756 union acpi_object params[2];
757 struct acpi_object_list arg_list;
758
759 list_for_each_entry(func, &slot->funcs, sibling) {
760 arg_list.count = 2;
761 arg_list.pointer = params;
762 params[0].type = ACPI_TYPE_INTEGER;
763 params[0].integer.value = ACPI_ADR_SPACE_PCI_CONFIG;
764 params[1].type = ACPI_TYPE_INTEGER;
765 params[1].integer.value = 1;
766 /* _REG is optional, we don't care about if there is failure */
767 acpi_evaluate_object(func->handle, "_REG", &arg_list, NULL);
768 }
769}
770
752/** 771/**
753 * enable_device - enable, configure a slot 772 * enable_device - enable, configure a slot
754 * @slot: slot to be enabled 773 * @slot: slot to be enabled
@@ -805,6 +824,7 @@ static int __ref enable_device(struct acpiphp_slot *slot)
805 pci_bus_assign_resources(bus); 824 pci_bus_assign_resources(bus);
806 acpiphp_sanitize_bus(bus); 825 acpiphp_sanitize_bus(bus);
807 acpiphp_set_hpp_values(bus); 826 acpiphp_set_hpp_values(bus);
827 acpiphp_set_acpi_region(slot);
808 pci_enable_bridges(bus); 828 pci_enable_bridges(bus);
809 pci_bus_add_devices(bus); 829 pci_bus_add_devices(bus);
810 830
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index aa5df485f8cf..6ecbfb27db9d 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/slab.h>
29#include <linux/module.h> 30#include <linux/module.h>
30#include <linux/kernel.h> 31#include <linux/kernel.h>
31#include <acpi/acpi_bus.h> 32#include <acpi/acpi_bus.h>
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index e6089bdb6e5b..56215322930a 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -28,6 +28,7 @@
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <linux/slab.h>
31#include <linux/types.h> 32#include <linux/types.h>
32#include <linux/proc_fs.h> 33#include <linux/proc_fs.h>
33#include <linux/workqueue.h> 34#include <linux/workqueue.h>
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 0a894efd4b9b..5317e4d7d96e 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/slab.h>
22#include "../pci.h" 23#include "../pci.h"
23 24
24struct legacy_slot { 25struct legacy_slot {
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 728b119f71ad..6d2eea93298f 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -33,7 +33,6 @@
33#include <linux/kobject.h> 33#include <linux/kobject.h>
34#include <linux/sysfs.h> 34#include <linux/sysfs.h>
35#include <linux/pagemap.h> 35#include <linux/pagemap.h>
36#include <linux/slab.h>
37#include <linux/init.h> 36#include <linux/init.h>
38#include <linux/mount.h> 37#include <linux/mount.h>
39#include <linux/namei.h> 38#include <linux/namei.h>
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c
index b09b083011d6..1f4000a5a108 100644
--- a/drivers/pci/hotplug/pciehp_acpi.c
+++ b/drivers/pci/hotplug/pciehp_acpi.c
@@ -26,6 +26,7 @@
26#include <linux/acpi.h> 26#include <linux/acpi.h>
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/pci_hotplug.h> 28#include <linux/pci_hotplug.h>
29#include <linux/slab.h>
29#include "pciehp.h" 30#include "pciehp.h"
30 31
31#define PCIEHP_DETECT_PCIE (0) 32#define PCIEHP_DETECT_PCIE (0)
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 920f820edf87..3588ea61b0dd 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/slab.h>
33#include <linux/types.h> 34#include <linux/types.h>
34#include <linux/pci.h> 35#include <linux/pci.h>
35#include "pciehp.h" 36#include "pciehp.h"
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 9a7f247e8ac1..8f58148be044 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/slab.h>
33#include <linux/pci.h> 34#include <linux/pci.h>
34#include <linux/workqueue.h> 35#include <linux/workqueue.h>
35#include "../pci.h" 36#include "../pci.h"
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 40b48f569b1e..0cd42047d89b 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -36,6 +36,7 @@
36#include <linux/pci.h> 36#include <linux/pci.h>
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <linux/time.h> 38#include <linux/time.h>
39#include <linux/slab.h>
39 40
40#include "../pci.h" 41#include "../pci.h"
41#include "pciehp.h" 42#include "pciehp.h"
@@ -832,9 +833,8 @@ static inline void dbg_ctrl(struct controller *ctrl)
832 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 833 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
833 if (!pci_resource_len(pdev, i)) 834 if (!pci_resource_len(pdev, i))
834 continue; 835 continue;
835 ctrl_info(ctrl, " PCI resource [%d] : 0x%llx@0x%llx\n", 836 ctrl_info(ctrl, " PCI resource [%d] : %pR\n",
836 i, (unsigned long long)pci_resource_len(pdev, i), 837 i, &pdev->resource[i]);
837 (unsigned long long)pci_resource_start(pdev, i));
838 } 838 }
839 ctrl_info(ctrl, "Slot Capabilities : 0x%08x\n", ctrl->slot_cap); 839 ctrl_info(ctrl, "Slot Capabilities : 0x%08x\n", ctrl->slot_cap);
840 ctrl_info(ctrl, " Physical Slot Number : %d\n", PSN(ctrl)); 840 ctrl_info(ctrl, " Physical Slot Number : %d\n", PSN(ctrl));
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index dcaae725fd79..719702240780 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -27,7 +27,6 @@
27#include <linux/moduleparam.h> 27#include <linux/moduleparam.h>
28#include <linux/pci.h> 28#include <linux/pci.h>
29#include <linux/pci_hotplug.h> 29#include <linux/pci_hotplug.h>
30#include <linux/slab.h>
31#include <linux/smp.h> 30#include <linux/smp.h>
32#include <linux/init.h> 31#include <linux/init.h>
33#include <asm/eeh.h> /* for eeh_add_device() */ 32#include <asm/eeh.h> /* for eeh_add_device() */
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index 8aebe1e9d3d6..72d507b6a2aa 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -15,6 +15,7 @@
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/pci_hotplug.h> 16#include <linux/pci_hotplug.h>
17#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
18#include <linux/slab.h>
18#include <linux/types.h> 19#include <linux/types.h>
19#include <linux/mutex.h> 20#include <linux/mutex.h>
20 21
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index a5062297f488..a7bd5048396e 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -31,6 +31,7 @@
31#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/slab.h>
34#include <linux/pci.h> 35#include <linux/pci.h>
35#include <linux/workqueue.h> 36#include <linux/workqueue.h>
36#include "shpchp.h" 37#include "shpchp.h"
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 3bba0c0888ff..3387fbfb0c54 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/slab.h>
33#include <linux/pci.h> 34#include <linux/pci.h>
34#include <linux/workqueue.h> 35#include <linux/workqueue.h>
35#include "../pci.h" 36#include "../pci.h"
diff --git a/drivers/pci/htirq.c b/drivers/pci/htirq.c
index 737a1c44b07a..98abf8b91294 100644
--- a/drivers/pci/htirq.c
+++ b/drivers/pci/htirq.c
@@ -10,7 +10,6 @@
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <linux/spinlock.h> 11#include <linux/spinlock.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/gfp.h>
14#include <linux/htirq.h> 13#include <linux/htirq.h>
15 14
16/* Global ht irq lock. 15/* Global ht irq lock.
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 95b849130ad4..6ee98a56946f 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -1,6 +1,7 @@
1#include <linux/interrupt.h> 1#include <linux/interrupt.h>
2#include <linux/dmar.h> 2#include <linux/dmar.h>
3#include <linux/spinlock.h> 3#include <linux/spinlock.h>
4#include <linux/slab.h>
4#include <linux/jiffies.h> 5#include <linux/jiffies.h>
5#include <linux/hpet.h> 6#include <linux/hpet.h>
6#include <linux/pci.h> 7#include <linux/pci.h>
diff --git a/drivers/pci/ioapic.c b/drivers/pci/ioapic.c
index 3e0d7b5dd1b9..203508b227b7 100644
--- a/drivers/pci/ioapic.c
+++ b/drivers/pci/ioapic.c
@@ -18,6 +18,7 @@
18 18
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/acpi.h> 20#include <linux/acpi.h>
21#include <linux/slab.h>
21#include <acpi/acpi_bus.h> 22#include <acpi/acpi_bus.h>
22 23
23struct ioapic { 24struct ioapic {
@@ -31,9 +32,9 @@ static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
31 acpi_status status; 32 acpi_status status;
32 unsigned long long gsb; 33 unsigned long long gsb;
33 struct ioapic *ioapic; 34 struct ioapic *ioapic;
34 u64 addr;
35 int ret; 35 int ret;
36 char *type; 36 char *type;
37 struct resource *res;
37 38
38 handle = DEVICE_ACPI_HANDLE(&dev->dev); 39 handle = DEVICE_ACPI_HANDLE(&dev->dev);
39 if (!handle) 40 if (!handle)
@@ -69,13 +70,12 @@ static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
69 if (pci_request_region(dev, 0, type)) 70 if (pci_request_region(dev, 0, type))
70 goto exit_disable; 71 goto exit_disable;
71 72
72 addr = pci_resource_start(dev, 0); 73 res = &dev->resource[0];
73 if (acpi_register_ioapic(ioapic->handle, addr, ioapic->gsi_base)) 74 if (acpi_register_ioapic(ioapic->handle, res->start, ioapic->gsi_base))
74 goto exit_release; 75 goto exit_release;
75 76
76 pci_set_drvdata(dev, ioapic); 77 pci_set_drvdata(dev, ioapic);
77 dev_info(&dev->dev, "%s at %#llx, GSI %u\n", type, addr, 78 dev_info(&dev->dev, "%s at %pR, GSI %u\n", type, res, ioapic->gsi_base);
78 ioapic->gsi_base);
79 return 0; 79 return 0;
80 80
81exit_release: 81exit_release:
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 3e5ab2bf6a5c..ce6a3666b3d9 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/slab.h>
12#include <linux/mutex.h> 13#include <linux/mutex.h>
13#include <linux/string.h> 14#include <linux/string.h>
14#include <linux/delay.h> 15#include <linux/delay.h>
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index f9cf3173b23d..77b68eaf021e 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -18,6 +18,7 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/slab.h>
21 22
22#include "pci.h" 23#include "pci.h"
23#include "msi.h" 24#include "msi.h"
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index de296452c957..fad93983bfed 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -23,6 +23,7 @@
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/capability.h> 24#include <linux/capability.h>
25#include <linux/pci-aspm.h> 25#include <linux/pci-aspm.h>
26#include <linux/slab.h>
26#include "pci.h" 27#include "pci.h"
27 28
28static int sysfs_initialized; /* = 0 */ 29static int sysfs_initialized; /* = 0 */
@@ -655,8 +656,8 @@ void pci_create_legacy_files(struct pci_bus *b)
655 goto legacy_io_err; 656 goto legacy_io_err;
656 657
657 /* Allocated above after the legacy_io struct */ 658 /* Allocated above after the legacy_io struct */
658 sysfs_bin_attr_init(b->legacy_mem);
659 b->legacy_mem = b->legacy_io + 1; 659 b->legacy_mem = b->legacy_io + 1;
660 sysfs_bin_attr_init(b->legacy_mem);
660 b->legacy_mem->attr.name = "legacy_mem"; 661 b->legacy_mem->attr.name = "legacy_mem";
661 b->legacy_mem->size = 1024*1024; 662 b->legacy_mem->size = 1024*1024;
662 b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR; 663 b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ddd55dc927f7..9a3d3309f896 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/pm.h> 14#include <linux/pm.h>
15#include <linux/slab.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/spinlock.h> 17#include <linux/spinlock.h>
17#include <linux/string.h> 18#include <linux/string.h>
@@ -2576,18 +2577,17 @@ EXPORT_SYMBOL_GPL(pci_reset_function);
2576 */ 2577 */
2577int pcix_get_max_mmrbc(struct pci_dev *dev) 2578int pcix_get_max_mmrbc(struct pci_dev *dev)
2578{ 2579{
2579 int err, cap; 2580 int cap;
2580 u32 stat; 2581 u32 stat;
2581 2582
2582 cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); 2583 cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
2583 if (!cap) 2584 if (!cap)
2584 return -EINVAL; 2585 return -EINVAL;
2585 2586
2586 err = pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat); 2587 if (pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat))
2587 if (err)
2588 return -EINVAL; 2588 return -EINVAL;
2589 2589
2590 return (stat & PCI_X_STATUS_MAX_READ) >> 12; 2590 return 512 << ((stat & PCI_X_STATUS_MAX_READ) >> 21);
2591} 2591}
2592EXPORT_SYMBOL(pcix_get_max_mmrbc); 2592EXPORT_SYMBOL(pcix_get_max_mmrbc);
2593 2593
@@ -2600,18 +2600,17 @@ EXPORT_SYMBOL(pcix_get_max_mmrbc);
2600 */ 2600 */
2601int pcix_get_mmrbc(struct pci_dev *dev) 2601int pcix_get_mmrbc(struct pci_dev *dev)
2602{ 2602{
2603 int ret, cap; 2603 int cap;
2604 u32 cmd; 2604 u16 cmd;
2605 2605
2606 cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); 2606 cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
2607 if (!cap) 2607 if (!cap)
2608 return -EINVAL; 2608 return -EINVAL;
2609 2609
2610 ret = pci_read_config_dword(dev, cap + PCI_X_CMD, &cmd); 2610 if (pci_read_config_word(dev, cap + PCI_X_CMD, &cmd))
2611 if (!ret) 2611 return -EINVAL;
2612 ret = 512 << ((cmd & PCI_X_CMD_MAX_READ) >> 2);
2613 2612
2614 return ret; 2613 return 512 << ((cmd & PCI_X_CMD_MAX_READ) >> 2);
2615} 2614}
2616EXPORT_SYMBOL(pcix_get_mmrbc); 2615EXPORT_SYMBOL(pcix_get_mmrbc);
2617 2616
@@ -2626,28 +2625,27 @@ EXPORT_SYMBOL(pcix_get_mmrbc);
2626 */ 2625 */
2627int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc) 2626int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
2628{ 2627{
2629 int cap, err = -EINVAL; 2628 int cap;
2630 u32 stat, cmd, v, o; 2629 u32 stat, v, o;
2630 u16 cmd;
2631 2631
2632 if (mmrbc < 512 || mmrbc > 4096 || !is_power_of_2(mmrbc)) 2632 if (mmrbc < 512 || mmrbc > 4096 || !is_power_of_2(mmrbc))
2633 goto out; 2633 return -EINVAL;
2634 2634
2635 v = ffs(mmrbc) - 10; 2635 v = ffs(mmrbc) - 10;
2636 2636
2637 cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); 2637 cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
2638 if (!cap) 2638 if (!cap)
2639 goto out; 2639 return -EINVAL;
2640 2640
2641 err = pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat); 2641 if (pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat))
2642 if (err) 2642 return -EINVAL;
2643 goto out;
2644 2643
2645 if (v > (stat & PCI_X_STATUS_MAX_READ) >> 21) 2644 if (v > (stat & PCI_X_STATUS_MAX_READ) >> 21)
2646 return -E2BIG; 2645 return -E2BIG;
2647 2646
2648 err = pci_read_config_dword(dev, cap + PCI_X_CMD, &cmd); 2647 if (pci_read_config_word(dev, cap + PCI_X_CMD, &cmd))
2649 if (err) 2648 return -EINVAL;
2650 goto out;
2651 2649
2652 o = (cmd & PCI_X_CMD_MAX_READ) >> 2; 2650 o = (cmd & PCI_X_CMD_MAX_READ) >> 2;
2653 if (o != v) { 2651 if (o != v) {
@@ -2657,10 +2655,10 @@ int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
2657 2655
2658 cmd &= ~PCI_X_CMD_MAX_READ; 2656 cmd &= ~PCI_X_CMD_MAX_READ;
2659 cmd |= v << 2; 2657 cmd |= v << 2;
2660 err = pci_write_config_dword(dev, cap + PCI_X_CMD, cmd); 2658 if (pci_write_config_word(dev, cap + PCI_X_CMD, cmd))
2659 return -EIO;
2661 } 2660 }
2662out: 2661 return 0;
2663 return err;
2664} 2662}
2665EXPORT_SYMBOL(pcix_set_mmrbc); 2663EXPORT_SYMBOL(pcix_set_mmrbc);
2666 2664
@@ -3023,7 +3021,6 @@ EXPORT_SYMBOL(pcim_pin_device);
3023EXPORT_SYMBOL(pci_disable_device); 3021EXPORT_SYMBOL(pci_disable_device);
3024EXPORT_SYMBOL(pci_find_capability); 3022EXPORT_SYMBOL(pci_find_capability);
3025EXPORT_SYMBOL(pci_bus_find_capability); 3023EXPORT_SYMBOL(pci_bus_find_capability);
3026EXPORT_SYMBOL(pci_register_set_vga_state);
3027EXPORT_SYMBOL(pci_release_regions); 3024EXPORT_SYMBOL(pci_release_regions);
3028EXPORT_SYMBOL(pci_request_regions); 3025EXPORT_SYMBOL(pci_request_regions);
3029EXPORT_SYMBOL(pci_request_regions_exclusive); 3026EXPORT_SYMBOL(pci_request_regions_exclusive);
diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c
index 223052b73563..f8f425b8731d 100644
--- a/drivers/pci/pcie/aer/aer_inject.c
+++ b/drivers/pci/pcie/aer/aer_inject.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/miscdevice.h> 22#include <linux/miscdevice.h>
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/slab.h>
24#include <linux/fs.h> 25#include <linux/fs.h>
25#include <linux/uaccess.h> 26#include <linux/uaccess.h>
26#include <linux/stddef.h> 27#include <linux/stddef.h>
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c
index 21f215f4daa3..aa495ad9bbd4 100644
--- a/drivers/pci/pcie/aer/aerdrv.c
+++ b/drivers/pci/pcie/aer/aerdrv.c
@@ -25,6 +25,7 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/pcieport_if.h> 27#include <linux/pcieport_if.h>
28#include <linux/slab.h>
28 29
29#include "aerdrv.h" 30#include "aerdrv.h"
30#include "../../pci.h" 31#include "../../pci.h"
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index c843a799814d..aceb04b67b60 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -23,6 +23,7 @@
23#include <linux/pm.h> 23#include <linux/pm.h>
24#include <linux/suspend.h> 24#include <linux/suspend.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/slab.h>
26#include "aerdrv.h" 27#include "aerdrv.h"
27 28
28static int forceload; 29static int forceload;
diff --git a/drivers/pci/pcie/pme/pcie_pme.c b/drivers/pci/pcie/pme/pcie_pme.c
index 7b3cbff547ee..aac285a16b62 100644
--- a/drivers/pci/pcie/pme/pcie_pme.c
+++ b/drivers/pci/pcie/pme/pcie_pme.c
@@ -14,6 +14,7 @@
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/slab.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/device.h> 20#include <linux/device.h>
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 127e8f169d9c..3debed25e46b 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -12,7 +12,6 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/pm.h> 13#include <linux/pm.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/slab.h>
16#include <linux/pcieport_if.h> 15#include <linux/pcieport_if.h>
17#include <linux/aer.h> 16#include <linux/aer.h>
18#include <linux/dmi.h> 17#include <linux/dmi.h>
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2a943090a3b7..882bd8d29fe3 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -174,14 +174,19 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
174 pci_read_config_dword(dev, pos, &sz); 174 pci_read_config_dword(dev, pos, &sz);
175 pci_write_config_dword(dev, pos, l); 175 pci_write_config_dword(dev, pos, l);
176 176
177 if (!sz)
178 goto fail; /* BAR not implemented */
179
177 /* 180 /*
178 * All bits set in sz means the device isn't working properly. 181 * All bits set in sz means the device isn't working properly.
179 * If the BAR isn't implemented, all bits must be 0. If it's a 182 * If it's a memory BAR or a ROM, bit 0 must be clear; if it's
180 * memory BAR or a ROM, bit 0 must be clear; if it's an io BAR, bit 183 * an io BAR, bit 1 must be clear.
181 * 1 must be clear.
182 */ 184 */
183 if (!sz || sz == 0xffffffff) 185 if (sz == 0xffffffff) {
186 dev_err(&dev->dev, "reg %x: invalid size %#x; broken device?\n",
187 pos, sz);
184 goto fail; 188 goto fail;
189 }
185 190
186 /* 191 /*
187 * I don't know how l can have all bits set. Copied from old code. 192 * I don't know how l can have all bits set. Copied from old code.
@@ -244,13 +249,17 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
244 pos, res); 249 pos, res);
245 } 250 }
246 } else { 251 } else {
247 sz = pci_size(l, sz, mask); 252 u32 size = pci_size(l, sz, mask);
248 253
249 if (!sz) 254 if (!size) {
255 dev_err(&dev->dev, "reg %x: invalid size "
256 "(l %#x sz %#x mask %#x); broken device?",
257 pos, l, sz, mask);
250 goto fail; 258 goto fail;
259 }
251 260
252 res->start = l; 261 res->start = l;
253 res->end = l + sz; 262 res->end = l + size;
254 263
255 dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); 264 dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
256 } 265 }
@@ -312,7 +321,7 @@ static void __devinit pci_read_bridge_io(struct pci_bus *child)
312 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); 321 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
313 } else { 322 } else {
314 dev_printk(KERN_DEBUG, &dev->dev, 323 dev_printk(KERN_DEBUG, &dev->dev,
315 " bridge window [io %04lx - %04lx] reg reading\n", 324 " bridge window [io %#06lx-%#06lx] (disabled)\n",
316 base, limit); 325 base, limit);
317 } 326 }
318} 327}
@@ -336,7 +345,7 @@ static void __devinit pci_read_bridge_mmio(struct pci_bus *child)
336 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); 345 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
337 } else { 346 } else {
338 dev_printk(KERN_DEBUG, &dev->dev, 347 dev_printk(KERN_DEBUG, &dev->dev,
339 " bridge window [mem 0x%08lx - 0x%08lx] reg reading\n", 348 " bridge window [mem %#010lx-%#010lx] (disabled)\n",
340 base, limit + 0xfffff); 349 base, limit + 0xfffff);
341 } 350 }
342} 351}
@@ -387,7 +396,7 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
387 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); 396 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
388 } else { 397 } else {
389 dev_printk(KERN_DEBUG, &dev->dev, 398 dev_printk(KERN_DEBUG, &dev->dev,
390 " bridge window [mem 0x%08lx - %08lx pref] reg reading\n", 399 " bridge window [mem %#010lx-%#010lx pref] (disabled)\n",
391 base, limit + 0xfffff); 400 base, limit + 0xfffff);
392 } 401 }
393} 402}
@@ -673,16 +682,20 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
673 int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS); 682 int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
674 u32 buses, i, j = 0; 683 u32 buses, i, j = 0;
675 u16 bctl; 684 u16 bctl;
685 u8 primary, secondary, subordinate;
676 int broken = 0; 686 int broken = 0;
677 687
678 pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); 688 pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
689 primary = buses & 0xFF;
690 secondary = (buses >> 8) & 0xFF;
691 subordinate = (buses >> 16) & 0xFF;
679 692
680 dev_dbg(&dev->dev, "scanning behind bridge, config %06x, pass %d\n", 693 dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n",
681 buses & 0xffffff, pass); 694 secondary, subordinate, pass);
682 695
683 /* Check if setup is sensible at all */ 696 /* Check if setup is sensible at all */
684 if (!pass && 697 if (!pass &&
685 ((buses & 0xff) != bus->number || ((buses >> 8) & 0xff) <= bus->number)) { 698 (primary != bus->number || secondary <= bus->number)) {
686 dev_dbg(&dev->dev, "bus configuration invalid, reconfiguring\n"); 699 dev_dbg(&dev->dev, "bus configuration invalid, reconfiguring\n");
687 broken = 1; 700 broken = 1;
688 } 701 }
@@ -693,15 +706,15 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
693 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, 706 pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
694 bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT); 707 bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
695 708
696 if ((buses & 0xffff00) && !pcibios_assign_all_busses() && !is_cardbus && !broken) { 709 if ((secondary || subordinate) && !pcibios_assign_all_busses() &&
697 unsigned int cmax, busnr; 710 !is_cardbus && !broken) {
711 unsigned int cmax;
698 /* 712 /*
699 * Bus already configured by firmware, process it in the first 713 * Bus already configured by firmware, process it in the first
700 * pass and just note the configuration. 714 * pass and just note the configuration.
701 */ 715 */
702 if (pass) 716 if (pass)
703 goto out; 717 goto out;
704 busnr = (buses >> 8) & 0xFF;
705 718
706 /* 719 /*
707 * If we already got to this bus through a different bridge, 720 * If we already got to this bus through a different bridge,
@@ -710,13 +723,13 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
710 * However, we continue to descend down the hierarchy and 723 * However, we continue to descend down the hierarchy and
711 * scan remaining child buses. 724 * scan remaining child buses.
712 */ 725 */
713 child = pci_find_bus(pci_domain_nr(bus), busnr); 726 child = pci_find_bus(pci_domain_nr(bus), secondary);
714 if (!child) { 727 if (!child) {
715 child = pci_add_new_bus(bus, dev, busnr); 728 child = pci_add_new_bus(bus, dev, secondary);
716 if (!child) 729 if (!child)
717 goto out; 730 goto out;
718 child->primary = buses & 0xFF; 731 child->primary = primary;
719 child->subordinate = (buses >> 16) & 0xFF; 732 child->subordinate = subordinate;
720 child->bridge_ctl = bctl; 733 child->bridge_ctl = bctl;
721 } 734 }
722 735
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 593bb844b8db..449e890267a2 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -6,6 +6,7 @@
6 6
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/slab.h>
9#include <linux/module.h> 10#include <linux/module.h>
10#include <linux/proc_fs.h> 11#include <linux/proc_fs.h>
11#include <linux/seq_file.h> 12#include <linux/seq_file.h>
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 81d19d5683ac..27c0e6eb7136 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -368,8 +368,9 @@ static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region,
368 bus_region.end = res->end; 368 bus_region.end = res->end;
369 pcibios_bus_to_resource(dev, res, &bus_region); 369 pcibios_bus_to_resource(dev, res, &bus_region);
370 370
371 pci_claim_resource(dev, nr); 371 if (pci_claim_resource(dev, nr) == 0)
372 dev_info(&dev->dev, "quirk: %pR claimed by %s\n", res, name); 372 dev_info(&dev->dev, "quirk: %pR claimed by %s\n",
373 res, name);
373 } 374 }
374} 375}
375 376
@@ -1977,11 +1978,25 @@ static void __devinit quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
1977 /* 1978 /*
1978 * Disable PCI Bus Parking and PCI Master read caching on CX700 1979 * Disable PCI Bus Parking and PCI Master read caching on CX700
1979 * which causes unspecified timing errors with a VT6212L on the PCI 1980 * which causes unspecified timing errors with a VT6212L on the PCI
1980 * bus leading to USB2.0 packet loss. The defaults are that these 1981 * bus leading to USB2.0 packet loss.
1981 * features are turned off but some BIOSes turn them on. 1982 *
1983 * This quirk is only enabled if a second (on the external PCI bus)
1984 * VT6212L is found -- the CX700 core itself also contains a USB
1985 * host controller with the same PCI ID as the VT6212L.
1982 */ 1986 */
1983 1987
1988 /* Count VT6212L instances */
1989 struct pci_dev *p = pci_get_device(PCI_VENDOR_ID_VIA,
1990 PCI_DEVICE_ID_VIA_8235_USB_2, NULL);
1984 uint8_t b; 1991 uint8_t b;
1992
1993 /* p should contain the first (internal) VT6212L -- see if we have
1994 an external one by searching again */
1995 p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235_USB_2, p);
1996 if (!p)
1997 return;
1998 pci_dev_put(p);
1999
1985 if (pci_read_config_byte(dev, 0x76, &b) == 0) { 2000 if (pci_read_config_byte(dev, 0x76, &b) == 0) {
1986 if (b & 0x40) { 2001 if (b & 0x40) {
1987 /* Turn off PCI Bus Parking */ 2002 /* Turn off PCI Bus Parking */
@@ -2008,7 +2023,7 @@ static void __devinit quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
2008 } 2023 }
2009 } 2024 }
2010} 2025}
2011DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_VIA, 0x324e, quirk_via_cx700_pci_parking_caching); 2026DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0x324e, quirk_via_cx700_pci_parking_caching);
2012 2027
2013/* 2028/*
2014 * For Broadcom 5706, 5708, 5709 rev. A nics, any read beyond the 2029 * For Broadcom 5706, 5708, 5709 rev. A nics, any read beyond the
@@ -2108,6 +2123,10 @@ static void __devinit quirk_disable_msi(struct pci_dev *dev)
2108 } 2123 }
2109} 2124}
2110DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi); 2125DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
2126DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
2127DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
2128DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AI, 0x9602, quirk_disable_msi);
2129DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);
2111 2130
2112/* Go through the list of Hypertransport capabilities and 2131/* Go through the list of Hypertransport capabilities and
2113 * return 1 if a HT MSI capability is found and enabled */ 2132 * return 1 if a HT MSI capability is found and enabled */
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 4a471dc4f4b9..20d03f772289 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -9,6 +9,7 @@
9 9
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/slab.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/interrupt.h> 14#include <linux/interrupt.h>
14#include "pci.h" 15#include "pci.h"
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 7d678bb15ffb..17bed18d24ad 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -93,8 +93,7 @@ void pci_update_resource(struct pci_dev *dev, int resno)
93int pci_claim_resource(struct pci_dev *dev, int resource) 93int pci_claim_resource(struct pci_dev *dev, int resource)
94{ 94{
95 struct resource *res = &dev->resource[resource]; 95 struct resource *res = &dev->resource[resource];
96 struct resource *root; 96 struct resource *root, *conflict;
97 int err;
98 97
99 root = pci_find_parent_resource(dev, res); 98 root = pci_find_parent_resource(dev, res);
100 if (!root) { 99 if (!root) {
@@ -103,12 +102,15 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
103 return -EINVAL; 102 return -EINVAL;
104 } 103 }
105 104
106 err = request_resource(root, res); 105 conflict = request_resource_conflict(root, res);
107 if (err) 106 if (conflict) {
108 dev_err(&dev->dev, 107 dev_err(&dev->dev,
109 "address space collision: %pR already in use\n", res); 108 "address space collision: %pR conflicts with %s %pR\n",
109 res, conflict->name, conflict);
110 return -EBUSY;
111 }
110 112
111 return err; 113 return 0;
112} 114}
113EXPORT_SYMBOL(pci_claim_resource); 115EXPORT_SYMBOL(pci_claim_resource);
114 116
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index f75a44d37fbe..659eaa0fc48f 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/kobject.h> 8#include <linux/kobject.h>
9#include <linux/slab.h>
9#include <linux/pci.h> 10#include <linux/pci.h>
10#include <linux/err.h> 11#include <linux/err.h>
11#include "pci.h" 12#include "pci.h"