Commit 9b5dfd3d authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Linus Torvalds

[PATCH] i386: apic_printk() used before initialized

Both detect_init_APIC() and init_apic_mappings() it's called from are
invoked early, before the command line has been processed.  Therefore its
meaningless to call apic_printk() from them as that depends on
apic_verbosity which is initialized from the command line.

I could move apic_verbosity initialization to parse_cmdline_early(), but I
think that would be an overkill, the point being we are initerested in
feedback from detect_init_APIC() anyway.  Without that it's hard to tell
what's really going on as it's been the case with the recent report of the
local APIC being non-functional despite the whole setup being apparently
correct.  So I converted these calls to ordinary printk() invocations.  The
init_apic_mappings() are less interesting, so I've made them output at the
debug level.

While at it I've made some obvious nearby formatting clean-up.
Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8c27e07f
...@@ -717,9 +717,8 @@ static int __init detect_init_APIC (void) ...@@ -717,9 +717,8 @@ static int __init detect_init_APIC (void)
* APIC only if "lapic" specified. * APIC only if "lapic" specified.
*/ */
if (enable_local_apic <= 0) { if (enable_local_apic <= 0) {
apic_printk(APIC_VERBOSE, printk("Local APIC disabled by BIOS -- "
"Local APIC disabled by BIOS -- " "you can enable it with \"lapic\"\n");
"you can enable it with \"lapic\"\n");
return -1; return -1;
} }
/* /*
...@@ -730,8 +729,7 @@ static int __init detect_init_APIC (void) ...@@ -730,8 +729,7 @@ static int __init detect_init_APIC (void)
*/ */
rdmsr(MSR_IA32_APICBASE, l, h); rdmsr(MSR_IA32_APICBASE, l, h);
if (!(l & MSR_IA32_APICBASE_ENABLE)) { if (!(l & MSR_IA32_APICBASE_ENABLE)) {
apic_printk(APIC_VERBOSE, "Local APIC disabled " printk("Local APIC disabled by BIOS -- reenabling.\n");
"by BIOS -- reenabling.\n");
l &= ~MSR_IA32_APICBASE_BASE; l &= ~MSR_IA32_APICBASE_BASE;
l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE; l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
wrmsr(MSR_IA32_APICBASE, l, h); wrmsr(MSR_IA32_APICBASE, l, h);
...@@ -758,7 +756,7 @@ static int __init detect_init_APIC (void) ...@@ -758,7 +756,7 @@ static int __init detect_init_APIC (void)
if (nmi_watchdog != NMI_NONE) if (nmi_watchdog != NMI_NONE)
nmi_watchdog = NMI_LOCAL_APIC; nmi_watchdog = NMI_LOCAL_APIC;
apic_printk(APIC_VERBOSE, "Found and enabled local APIC!\n"); printk("Found and enabled local APIC!\n");
apic_pm_activate(); apic_pm_activate();
...@@ -785,8 +783,8 @@ void __init init_apic_mappings(void) ...@@ -785,8 +783,8 @@ void __init init_apic_mappings(void)
apic_phys = mp_lapic_addr; apic_phys = mp_lapic_addr;
set_fixmap_nocache(FIX_APIC_BASE, apic_phys); set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
apic_printk(APIC_DEBUG, "mapped APIC to %08lx (%08lx)\n", APIC_BASE, printk(KERN_DEBUG "mapped APIC to %08lx (%08lx)\n", APIC_BASE,
apic_phys); apic_phys);
/* /*
* Fetch the APIC ID of the BSP in case we have a * Fetch the APIC ID of the BSP in case we have a
...@@ -804,21 +802,23 @@ void __init init_apic_mappings(void) ...@@ -804,21 +802,23 @@ void __init init_apic_mappings(void)
if (smp_found_config) { if (smp_found_config) {
ioapic_phys = mp_ioapics[i].mpc_apicaddr; ioapic_phys = mp_ioapics[i].mpc_apicaddr;
if (!ioapic_phys) { if (!ioapic_phys) {
printk(KERN_ERR "WARNING: bogus zero IO-APIC address found in MPTABLE, disabling IO/APIC support!\n"); printk(KERN_ERR
"WARNING: bogus zero IO-APIC "
"address found in MPTABLE, "
"disabling IO/APIC support!\n");
smp_found_config = 0; smp_found_config = 0;
skip_ioapic_setup = 1; skip_ioapic_setup = 1;
goto fake_ioapic_page; goto fake_ioapic_page;
} }
} else { } else {
fake_ioapic_page: fake_ioapic_page:
ioapic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); ioapic_phys = (unsigned long)
alloc_bootmem_pages(PAGE_SIZE);
ioapic_phys = __pa(ioapic_phys); ioapic_phys = __pa(ioapic_phys);
} }
set_fixmap_nocache(idx, ioapic_phys); set_fixmap_nocache(idx, ioapic_phys);
apic_printk(APIC_DEBUG, "mapped IOAPIC to " printk(KERN_DEBUG "mapped IOAPIC to %08lx (%08lx)\n",
"%08lx (%08lx)\n", __fix_to_virt(idx), ioapic_phys);
__fix_to_virt(idx), ioapic_phys);
idx++; idx++;
} }
} }
......
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