提交 8c57786a 编写于 作者: B Bjorn Helgaas 提交者: Jesse Barnes

x86/PCI: MMCONFIG: clean up printks

No functional change; just tidy up printks and make them more consistent
with the rest of PCI.
Reviewed-by: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 ba2afbab
...@@ -90,6 +90,10 @@ static __init struct pci_mmcfg_region *pci_mmconfig_add(int segment, int start, ...@@ -90,6 +90,10 @@ static __init struct pci_mmcfg_region *pci_mmconfig_add(int segment, int start,
"PCI MMCONFIG %04x [bus %02x-%02x]", segment, start, end); "PCI MMCONFIG %04x [bus %02x-%02x]", segment, start, end);
res->name = new->name; res->name = new->name;
printk(KERN_INFO PREFIX "MMCONFIG for domain %04x [bus %02x-%02x] at "
"%pR (base %#lx)\n", segment, start, end, &new->res,
(unsigned long) addr);
return new; return new;
} }
...@@ -333,7 +337,7 @@ static int __init pci_mmcfg_check_hostbridge(void) ...@@ -333,7 +337,7 @@ static int __init pci_mmcfg_check_hostbridge(void)
name = pci_mmcfg_probes[i].probe(); name = pci_mmcfg_probes[i].probe();
if (name) if (name)
printk(KERN_INFO "PCI: Found %s with MMCONFIG support.\n", printk(KERN_INFO PREFIX "%s with MMCONFIG support\n",
name); name);
} }
...@@ -425,7 +429,7 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used) ...@@ -425,7 +429,7 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used)
typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type); typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type);
static int __init is_mmconf_reserved(check_reserved_t is_reserved, static int __init is_mmconf_reserved(check_reserved_t is_reserved,
int i, struct pci_mmcfg_region *cfg, int with_e820) struct pci_mmcfg_region *cfg, int with_e820)
{ {
u64 addr = cfg->res.start; u64 addr = cfg->res.start;
u64 size = resource_size(&cfg->res); u64 size = resource_size(&cfg->res);
...@@ -439,9 +443,9 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved, ...@@ -439,9 +443,9 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
} }
if (size >= (16UL<<20) || size == old_size) { if (size >= (16UL<<20) || size == old_size) {
printk(KERN_NOTICE printk(KERN_INFO PREFIX "MMCONFIG at %pR reserved in %s\n",
"PCI: MCFG area at %Lx reserved in %s\n", &cfg->res,
addr, with_e820?"E820":"ACPI motherboard resources"); with_e820 ? "E820" : "ACPI motherboard resources");
valid = 1; valid = 1;
if (old_size != size) { if (old_size != size) {
...@@ -453,11 +457,11 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved, ...@@ -453,11 +457,11 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
snprintf(cfg->name, PCI_MMCFG_RESOURCE_NAME_LEN, snprintf(cfg->name, PCI_MMCFG_RESOURCE_NAME_LEN,
"PCI MMCONFIG %04x [bus %02x-%02x]", "PCI MMCONFIG %04x [bus %02x-%02x]",
cfg->segment, cfg->start_bus, cfg->end_bus); cfg->segment, cfg->start_bus, cfg->end_bus);
printk(KERN_NOTICE "PCI: updated MCFG configuration %d: base %lx " printk(KERN_INFO PREFIX
"segment %hu buses %u - %u\n", "MMCONFIG for %04x [bus%02x-%02x] "
i, (unsigned long)cfg->address, cfg->segment, "at %pR (base %#lx) (size reduced!)\n",
(unsigned int)cfg->start_bus, cfg->segment, cfg->start_bus, cfg->end_bus,
(unsigned int)cfg->end_bus); &cfg->res, (unsigned long) cfg->address);
} }
} }
...@@ -467,33 +471,25 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved, ...@@ -467,33 +471,25 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
static void __init pci_mmcfg_reject_broken(int early) static void __init pci_mmcfg_reject_broken(int early)
{ {
struct pci_mmcfg_region *cfg; struct pci_mmcfg_region *cfg;
int i;
list_for_each_entry(cfg, &pci_mmcfg_list, list) { list_for_each_entry(cfg, &pci_mmcfg_list, list) {
int valid = 0; int valid = 0;
printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx "
"segment %hu buses %u - %u\n",
i, (unsigned long)cfg->address, cfg->segment,
(unsigned int)cfg->start_bus,
(unsigned int)cfg->end_bus);
i++;
if (!early && !acpi_disabled) if (!early && !acpi_disabled)
valid = is_mmconf_reserved(is_acpi_reserved, i, cfg, 0); valid = is_mmconf_reserved(is_acpi_reserved, cfg, 0);
if (valid) if (valid)
continue; continue;
if (!early) if (!early)
printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %Lx is not" printk(KERN_ERR FW_BUG PREFIX
" reserved in ACPI motherboard resources\n", "MMCONFIG at %pR not reserved in "
cfg->address); "ACPI motherboard resources\n", &cfg->res);
/* Don't try to do this check unless configuration /* Don't try to do this check unless configuration
type 1 is available. how about type 2 ?*/ type 1 is available. how about type 2 ?*/
if (raw_pci_ops) if (raw_pci_ops)
valid = is_mmconf_reserved(e820_all_mapped, i, cfg, 1); valid = is_mmconf_reserved(e820_all_mapped, cfg, 1);
if (!valid) if (!valid)
goto reject; goto reject;
...@@ -502,7 +498,7 @@ static void __init pci_mmcfg_reject_broken(int early) ...@@ -502,7 +498,7 @@ static void __init pci_mmcfg_reject_broken(int early)
return; return;
reject: reject:
printk(KERN_INFO "PCI: Not using MMCONFIG.\n"); printk(KERN_INFO PREFIX "not using MMCONFIG\n");
free_all_mmcfg(); free_all_mmcfg();
} }
...@@ -525,7 +521,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg, ...@@ -525,7 +521,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
return 0; return 0;
} }
printk(KERN_ERR PREFIX "MCFG region for %04x:%02x-%02x at %#llx " printk(KERN_ERR PREFIX "MCFG region for %04x [bus %02x-%02x] at %#llx "
"is above 4GB, ignored\n", cfg->pci_segment, "is above 4GB, ignored\n", cfg->pci_segment,
cfg->start_bus_number, cfg->end_bus_number, cfg->address); cfg->start_bus_number, cfg->end_bus_number, cfg->address);
return -EINVAL; return -EINVAL;
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/pci_x86.h> #include <asm/pci_x86.h>
#define PREFIX "PCI: "
static char __iomem *get_virt(unsigned int seg, unsigned bus) static char __iomem *get_virt(unsigned int seg, unsigned bus)
{ {
struct pci_mmcfg_region *cfg; struct pci_mmcfg_region *cfg;
...@@ -109,11 +111,8 @@ static void __iomem * __init mcfg_ioremap(struct pci_mmcfg_region *cfg) ...@@ -109,11 +111,8 @@ static void __iomem * __init mcfg_ioremap(struct pci_mmcfg_region *cfg)
num_buses = cfg->end_bus - cfg->start_bus + 1; num_buses = cfg->end_bus - cfg->start_bus + 1;
size = PCI_MMCFG_BUS_OFFSET(num_buses); size = PCI_MMCFG_BUS_OFFSET(num_buses);
addr = ioremap_nocache(start, size); addr = ioremap_nocache(start, size);
if (addr) { if (addr)
printk(KERN_INFO "PCI: Using MMCONFIG at %Lx - %Lx\n",
start, start + size - 1);
addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus); addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus);
}
return addr; return addr;
} }
...@@ -124,9 +123,8 @@ int __init pci_mmcfg_arch_init(void) ...@@ -124,9 +123,8 @@ int __init pci_mmcfg_arch_init(void)
list_for_each_entry(cfg, &pci_mmcfg_list, list) { list_for_each_entry(cfg, &pci_mmcfg_list, list) {
cfg->virt = mcfg_ioremap(cfg); cfg->virt = mcfg_ioremap(cfg);
if (!cfg->virt) { if (!cfg->virt) {
printk(KERN_ERR "PCI: Cannot map mmconfig aperture for " printk(KERN_ERR PREFIX "can't map MMCONFIG at %pR\n",
"segment %d\n", &cfg->res);
cfg->segment);
pci_mmcfg_arch_free(); pci_mmcfg_arch_free();
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册