aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/mmconfig-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/mmconfig-shared.c')
-rw-r--r--arch/x86/pci/mmconfig-shared.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 067a2cfed15c..4820f0e8c594 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -355,8 +355,9 @@ static void __init pci_mmcfg_insert_resources(void)
355 snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, 355 snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN,
356 "PCI MMCONFIG %u [%02x-%02x]", cfg->pci_segment, 356 "PCI MMCONFIG %u [%02x-%02x]", cfg->pci_segment,
357 cfg->start_bus_number, cfg->end_bus_number); 357 cfg->start_bus_number, cfg->end_bus_number);
358 res->start = cfg->address + (cfg->start_bus_number << 20); 358 res->start = cfg->address +
359 res->end = res->start + (num_buses << 20) - 1; 359 PCI_MMCFG_BUS_OFFSET(cfg->start_bus_number);
360 res->end = res->start + PCI_MMCFG_BUS_OFFSET(num_buses) - 1;
360 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; 361 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
361 insert_resource(&iomem_resource, res); 362 insert_resource(&iomem_resource, res);
362 names += PCI_MMCFG_RESOURCE_NAME_LEN; 363 names += PCI_MMCFG_RESOURCE_NAME_LEN;
@@ -478,15 +479,14 @@ static void __init pci_mmcfg_reject_broken(int early)
478 return; 479 return;
479 480
480 for (i = 0; i < pci_mmcfg_config_num; i++) { 481 for (i = 0; i < pci_mmcfg_config_num; i++) {
481 int valid = 0; 482 int num_buses, valid = 0;
482 u64 addr, size; 483 u64 addr, size;
483 484
484 cfg = &pci_mmcfg_config[i]; 485 cfg = &pci_mmcfg_config[i];
485 addr = cfg->start_bus_number; 486 addr = cfg->address +
486 addr <<= 20; 487 PCI_MMCFG_BUS_OFFSET(cfg->start_bus_number);
487 addr += cfg->address; 488 num_buses = cfg->end_bus_number - cfg->start_bus_number + 1;
488 size = cfg->end_bus_number + 1 - cfg->start_bus_number; 489 size = PCI_MMCFG_BUS_OFFSET(num_buses);
489 size <<= 20;
490 printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx " 490 printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx "
491 "segment %hu buses %u - %u\n", 491 "segment %hu buses %u - %u\n",
492 i, (unsigned long)cfg->address, cfg->pci_segment, 492 i, (unsigned long)cfg->address, cfg->pci_segment,