Skip to content

Commit c96ec95

Browse files
committed
x86/gart: Tidy messages and add bridge device info
Print the AGP bridge info the same way as the rest of the kernel, e.g., "0000:00:04.0" instead of "00:04:00". Also print the AGP aperture address range the same way we print resources, and label it explicitly as a bus address range. No functional change except the message changes. Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent a5d3244 commit c96ec95

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

arch/x86/kernel/aperture_64.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ static u32 __init allocate_aperture(void)
7777
addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
7878
aper_size, aper_size);
7979
if (!addr) {
80-
pr_err("Cannot allocate aperture memory hole (%lx,%uK)\n",
81-
addr, aper_size>>10);
80+
pr_err("Cannot allocate aperture memory hole [mem %#010lx-%#010lx] (%uKB)\n",
81+
addr, addr + aper_size - 1, aper_size >> 10);
8282
return 0;
8383
}
8484
memblock_reserve(addr, aper_size);
85-
pr_info("Mapping aperture over %d KB of RAM @ %lx\n", aper_size >> 10,
86-
addr);
85+
pr_info("Mapping aperture over RAM [mem %#010lx-%#010lx] (%uKB)\n",
86+
addr, addr + aper_size - 1, aper_size >> 10);
8787
register_nosave_region(addr >> PAGE_SHIFT,
8888
(addr+aper_size) >> PAGE_SHIFT);
8989

@@ -127,10 +127,11 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
127127
u64 aper;
128128
u32 old_order;
129129

130-
pr_info("AGP bridge at %02x:%02x:%02x\n", bus, slot, func);
130+
pr_info("pci 0000:%02x:%02x:%02x: AGP bridge\n", bus, slot, func);
131131
apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14);
132132
if (apsizereg == 0xffffffff) {
133-
pr_err("APSIZE in AGP bridge unreadable\n");
133+
pr_err("pci 0000:%02x:%02x.%d: APSIZE unreadable\n",
134+
bus, slot, func);
134135
return 0;
135136
}
136137

@@ -154,15 +155,17 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
154155
* On some sick chips, APSIZE is 0. It means it wants 4G
155156
* so let double check that order, and lets trust AMD NB settings:
156157
*/
157-
pr_info("Aperture from AGP @ %Lx old size %u MB\n",
158-
aper, 32 << old_order);
158+
pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (old size %uMB)\n",
159+
bus, slot, func, aper, aper + (32ULL << (old_order + 20)) - 1,
160+
32 << old_order);
159161
if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) {
160-
pr_info("Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n",
161-
32 << *order, apsizereg);
162+
pr_info("pci 0000:%02x:%02x.%d: AGP aperture size %uMB (APSIZE %#x) is not right, using settings from NB\n",
163+
bus, slot, func, 32 << *order, apsizereg);
162164
*order = old_order;
163165
}
164166

165-
pr_info("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", aper,
167+
pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (%uMB, APSIZE %#x)\n",
168+
bus, slot, func, aper, aper + (32ULL << (*order + 20)) - 1,
166169
32 << *order, apsizereg);
167170

168171
if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20))
@@ -311,7 +314,8 @@ void __init early_gart_iommu_check(void)
311314
if (e820_any_mapped(aper_base, aper_base + aper_size,
312315
E820_RAM)) {
313316
/* reserve it, so we can reuse it in second kernel */
314-
pr_info("update e820 for GART\n");
317+
pr_info("e820: reserve [mem %#010Lx-%#010Lx] for GART\n",
318+
aper_base, aper_base + aper_size - 1);
315319
e820_add_region(aper_base, aper_size, E820_RESERVED);
316320
update_e820();
317321
}
@@ -396,8 +400,9 @@ int __init gart_iommu_hole_init(void)
396400
aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
397401
aper_base <<= 25;
398402

399-
pr_info("Node %d: aperture @ %Lx size %u MB\n",
400-
node, aper_base, aper_size >> 20);
403+
pr_info("Node %d: aperture [bus addr %#010Lx-%#010Lx] (%uMB)\n",
404+
node, aper_base, aper_base + aper_size - 1,
405+
aper_size >> 20);
401406
node++;
402407

403408
if (!aperture_valid(aper_base, aper_size, 64<<20)) {
@@ -408,7 +413,7 @@ int __init gart_iommu_hole_init(void)
408413
if (!no_iommu &&
409414
max_pfn > MAX_DMA32_PFN &&
410415
!printed_gart_size_msg) {
411-
pr_err("you are using iommu with agp, but GART size is less than 64M\n");
416+
pr_err("you are using iommu with agp, but GART size is less than 64MB\n");
412417
pr_err("please increase GART size in your BIOS setup\n");
413418
pr_err("if BIOS doesn't have that option, contact your HW vendor!\n");
414419
printed_gart_size_msg = 1;
@@ -449,7 +454,7 @@ int __init gart_iommu_hole_init(void)
449454
fallback_aper_force) {
450455
pr_info("Your BIOS doesn't leave a aperture memory hole\n");
451456
pr_info("Please enable the IOMMU option in the BIOS setup\n");
452-
pr_info("This costs you %d MB of RAM\n",
457+
pr_info("This costs you %dMB of RAM\n",
453458
32 << fallback_aper_order);
454459

455460
aper_order = fallback_aper_order;

0 commit comments

Comments
 (0)