x86/PCI: MMCONFIG: clean up printks
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Sat, 14 Nov 2009 00:34:59 +0000 (17:34 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 24 Nov 2009 23:30:30 +0000 (15:30 -0800)
No functional change; just tidy up printks and make them more consistent
with the rest of PCI.

Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
arch/x86/pci/mmconfig-shared.c
arch/x86/pci/mmconfig_64.c

index 392f8fe..71d69b8 100644 (file)
@@ -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);
        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;
 }
 
@@ -333,7 +337,7 @@ static int __init pci_mmcfg_check_hostbridge(void)
                        name = pci_mmcfg_probes[i].probe();
 
                if (name)
-                       printk(KERN_INFO "PCI: Found %s with MMCONFIG support.\n",
+                       printk(KERN_INFO PREFIX "%s with MMCONFIG support\n",
                               name);
        }
 
@@ -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);
 
 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 size = resource_size(&cfg->res);
@@ -439,9 +443,9 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
        }
 
        if (size >= (16UL<<20) || size == old_size) {
-               printk(KERN_NOTICE
-                      "PCI: MCFG area at %Lx reserved in %s\n",
-                       addr, with_e820?"E820":"ACPI motherboard resources");
+               printk(KERN_INFO PREFIX "MMCONFIG at %pR reserved in %s\n",
+                      &cfg->res,
+                      with_e820 ? "E820" : "ACPI motherboard resources");
                valid = 1;
 
                if (old_size != size) {
@@ -453,11 +457,11 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
                        snprintf(cfg->name, PCI_MMCFG_RESOURCE_NAME_LEN,
                                 "PCI MMCONFIG %04x [bus %02x-%02x]",
                                 cfg->segment, cfg->start_bus, cfg->end_bus);
-                       printk(KERN_NOTICE "PCI: updated 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);
+                       printk(KERN_INFO PREFIX
+                              "MMCONFIG for %04x [bus%02x-%02x] "
+                              "at %pR (base %#lx) (size reduced!)\n",
+                              cfg->segment, cfg->start_bus, cfg->end_bus,
+                              &cfg->res, (unsigned long) cfg->address);
                }
        }
 
@@ -467,33 +471,25 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
 static void __init pci_mmcfg_reject_broken(int early)
 {
        struct pci_mmcfg_region *cfg;
-       int i;
 
        list_for_each_entry(cfg, &pci_mmcfg_list, list) {
                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)
-                       valid = is_mmconf_reserved(is_acpi_reserved, i, cfg, 0);
+                       valid = is_mmconf_reserved(is_acpi_reserved, cfg, 0);
 
                if (valid)
                        continue;
 
                if (!early)
-                       printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %Lx is not"
-                              " reserved in ACPI motherboard resources\n",
-                              cfg->address);
+                       printk(KERN_ERR FW_BUG PREFIX
+                              "MMCONFIG at %pR not reserved in "
+                              "ACPI motherboard resources\n", &cfg->res);
 
                /* Don't try to do this check unless configuration
                   type 1 is available. how about type 2 ?*/
                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)
                        goto reject;
@@ -502,7 +498,7 @@ static void __init pci_mmcfg_reject_broken(int early)
        return;
 
 reject:
-       printk(KERN_INFO "PCI: Not using MMCONFIG.\n");
+       printk(KERN_INFO PREFIX "not using MMCONFIG\n");
        free_all_mmcfg();
 }
 
@@ -525,7 +521,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
                        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,
               cfg->start_bus_number, cfg->end_bus_number, cfg->address);
        return -EINVAL;
index ed1f479..cfa6cdb 100644 (file)
@@ -12,6 +12,8 @@
 #include <asm/e820.h>
 #include <asm/pci_x86.h>
 
+#define PREFIX "PCI: "
+
 static char __iomem *get_virt(unsigned int seg, unsigned bus)
 {
        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;
        size = PCI_MMCFG_BUS_OFFSET(num_buses);
        addr = ioremap_nocache(start, size);
-       if (addr) {
-               printk(KERN_INFO "PCI: Using MMCONFIG at %Lx - %Lx\n",
-                      start, start + size - 1);
+       if (addr)
                addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus);
-       }
        return addr;
 }
 
@@ -124,9 +123,8 @@ int __init pci_mmcfg_arch_init(void)
        list_for_each_entry(cfg, &pci_mmcfg_list, list) {
                cfg->virt = mcfg_ioremap(cfg);
                if (!cfg->virt) {
-                       printk(KERN_ERR "PCI: Cannot map mmconfig aperture for "
-                                       "segment %d\n",
-                               cfg->segment);
+                       printk(KERN_ERR PREFIX "can't map MMCONFIG at %pR\n",
+                              &cfg->res);
                        pci_mmcfg_arch_free();
                        return 0;
                }