diff options
Diffstat (limited to 'arch/x86/pci/mmconfig_64.c')
-rw-r--r-- | arch/x86/pci/mmconfig_64.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c index 4095e4d66a1d..c4cf318e44a9 100644 --- a/arch/x86/pci/mmconfig_64.c +++ b/arch/x86/pci/mmconfig_64.c | |||
@@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus) | |||
40 | static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) | 40 | static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) |
41 | { | 41 | { |
42 | char __iomem *addr; | 42 | char __iomem *addr; |
43 | if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS && | 43 | |
44 | test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots)) | ||
45 | return NULL; | ||
46 | addr = get_virt(seg, bus); | 44 | addr = get_virt(seg, bus); |
47 | if (!addr) | 45 | if (!addr) |
48 | return NULL; | 46 | return NULL; |
@@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, | |||
56 | 54 | ||
57 | /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ | 55 | /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ |
58 | if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { | 56 | if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { |
59 | *value = -1; | 57 | err: *value = -1; |
60 | return -EINVAL; | 58 | return -EINVAL; |
61 | } | 59 | } |
62 | 60 | ||
61 | if (reg < 256) | ||
62 | return pci_conf1_read(seg,bus,devfn,reg,len,value); | ||
63 | |||
63 | addr = pci_dev_base(seg, bus, devfn); | 64 | addr = pci_dev_base(seg, bus, devfn); |
64 | if (!addr) | 65 | if (!addr) |
65 | return pci_conf1_read(seg,bus,devfn,reg,len,value); | 66 | goto err; |
66 | 67 | ||
67 | switch (len) { | 68 | switch (len) { |
68 | case 1: | 69 | case 1: |
@@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, | |||
88 | if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) | 89 | if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) |
89 | return -EINVAL; | 90 | return -EINVAL; |
90 | 91 | ||
92 | if (reg < 256) | ||
93 | return pci_conf1_write(seg,bus,devfn,reg,len,value); | ||
94 | |||
91 | addr = pci_dev_base(seg, bus, devfn); | 95 | addr = pci_dev_base(seg, bus, devfn); |
92 | if (!addr) | 96 | if (!addr) |
93 | return pci_conf1_write(seg,bus,devfn,reg,len,value); | 97 | return -EINVAL; |
94 | 98 | ||
95 | switch (len) { | 99 | switch (len) { |
96 | case 1: | 100 | case 1: |
@@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg) | |||
126 | return addr; | 130 | return addr; |
127 | } | 131 | } |
128 | 132 | ||
129 | int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, | ||
130 | unsigned int devfn) | ||
131 | { | ||
132 | return pci_dev_base(seg, bus, devfn) != NULL; | ||
133 | } | ||
134 | |||
135 | int __init pci_mmcfg_arch_init(void) | 133 | int __init pci_mmcfg_arch_init(void) |
136 | { | 134 | { |
137 | int i; | 135 | int i; |