Commit 56829d19 authored by OGAWA Hirofumi's avatar OGAWA Hirofumi Committed by Andi Kleen

[PATCH] mmconfig: fix unreachable_devices()

Currently, unreachable_devices() compares value of mmconfig and value
of conf1. But it doesn't check the device is reachable or not.
Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent 429d512e
...@@ -43,12 +43,14 @@ static void __init unreachable_devices(void) ...@@ -43,12 +43,14 @@ static void __init unreachable_devices(void)
if (val1 == 0xffffffff) if (val1 == 0xffffffff)
continue; continue;
if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
raw_pci_ops->read(0, bus, devfn, 0, 4, &val2); raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
if (val1 != val2) { if (val1 == val2)
set_bit(i + 32 * bus, pci_mmcfg_fallback_slots); continue;
printk(KERN_NOTICE "PCI: No mmconfig possible"
" on device %02x:%02x\n", bus, i);
} }
set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
printk(KERN_NOTICE "PCI: No mmconfig possible on device"
" %02x:%02x\n", bus, i);
} }
} }
} }
......
...@@ -136,6 +136,12 @@ static struct pci_raw_ops pci_mmcfg = { ...@@ -136,6 +136,12 @@ static struct pci_raw_ops pci_mmcfg = {
.write = pci_mmcfg_write, .write = pci_mmcfg_write,
}; };
int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
unsigned int devfn)
{
return get_base_addr(seg, bus, devfn) != 0;
}
int __init pci_mmcfg_arch_init(void) int __init pci_mmcfg_arch_init(void)
{ {
printk(KERN_INFO "PCI: Using MMCONFIG\n"); printk(KERN_INFO "PCI: Using MMCONFIG\n");
......
...@@ -101,4 +101,6 @@ extern void pcibios_sort(void); ...@@ -101,4 +101,6 @@ extern void pcibios_sort(void);
#define PCI_MMCFG_MAX_CHECK_BUS 16 #define PCI_MMCFG_MAX_CHECK_BUS 16
extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS); extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
unsigned int devfn);
extern int __init pci_mmcfg_arch_init(void); extern int __init pci_mmcfg_arch_init(void);
...@@ -126,6 +126,12 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg) ...@@ -126,6 +126,12 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
return addr; return addr;
} }
int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
unsigned int devfn)
{
return pci_dev_base(seg, bus, devfn) != NULL;
}
int __init pci_mmcfg_arch_init(void) int __init pci_mmcfg_arch_init(void)
{ {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment