Re: WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy

From: Vegard Nossum
Date: Wed Jun 17 2009 - 12:38:56 EST


2009/6/17 Cyrill Gorcunov <gorcunov@xxxxxxxxx>:
> Vegard, could you test the patch?
>
> Â Â Â Â-- Cyrill
> ---
>
> If we have apic disabled we don't even switch to APIC mode and do not
> calling for connect_bsp_APIC. Though on SMP compiled kernel the
> native_machine_shutdown does try to write the apic register anyway.
> Fix it with explicit check if we really should touch apic registers.
>
> Reported-by: Vegard Nossum <vegard.nossum@xxxxxxxxx>
> Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
> ---
> Âarch/x86/kernel/apic/io_apic.c | Â Â4 +++-
> Â1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: linux-2.6.git/arch/x86/kernel/apic/io_apic.c
> =====================================================================
> --- linux-2.6.git.orig/arch/x86/kernel/apic/io_apic.c
> +++ linux-2.6.git/arch/x86/kernel/apic/io_apic.c
> @@ -2003,7 +2003,9 @@ void disable_IO_APIC(void)
> Â Â Â Â/*
> Â Â Â Â * Use virtual wire A mode when interrupt remapping is enabled.
> Â Â Â Â */
> - Â Â Â disconnect_bsp_APIC(!intr_remapping_enabled && ioapic_i8259.pin != -1);
> + Â Â Â if (cpu_has_apic)
> + Â Â Â Â Â Â Â disconnect_bsp_APIC(!intr_remapping_enabled &&
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ioapic_i8259.pin != -1);
> Â}
>
> Â#ifdef CONFIG_X86_32
>

Seems to work here:

[ 317.596743] ACPI: Preparing to enter system sleep state S5
[ 317.633421] Disabling non-boot CPUs ...
[ 317.637493] Power down.
[ 317.638305] acpi_power_off called

and no warning.

Thanks!


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/