lkml.org 
[lkml]   [2003]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH][2.6.0-test3] Disable APIC on reboot.
On Tue, 12 Aug 2003, Mikael Pettersson wrote:

> > You obviously want to disable I/O APICs first.
>
> This follows the same order that the SMP reboot code has been using
> for ages. I did check disable_IO_APIC(), and it does not depend on
> the BP's local APIC being enabled.

Well, I meant the hardware POV.

> I don't think there is a bug, but if there is, it's in the original
> code too (simply trace what an SMP kernel on UP_IOAPIC HW would do).

We might not care that much that hardware goes wild just before it's
disabled, but it doesn't mean it's OK. The bug is indeed in the original
code. I think disable_IO_APIC() should precede smp_send_stop() and
disconnect_bsp_APIC() should be called from smp_send_stop(). More or
less like this (before your fix):

patch-mips-2.6.0-test2-20030804-apic-reboot-0
diff -up --recursive --new-file linux-mips-2.6.0-test2-20030804.macro/arch/i386/kernel/io_apic.c linux-mips-2.6.0-test2-20030804/arch/i386/kernel/io_apic.c
--- linux-mips-2.6.0-test2-20030804.macro/arch/i386/kernel/io_apic.c 2003-07-30 03:56:43.000000000 +0000
+++ linux-mips-2.6.0-test2-20030804/arch/i386/kernel/io_apic.c 2003-08-12 14:21:24.000000000 +0000
@@ -1598,8 +1598,6 @@ void disable_IO_APIC(void)
* Clear the IO-APIC before rebooting:
*/
clear_IO_APIC();
-
- disconnect_bsp_APIC();
}

/*
diff -up --recursive --new-file linux-mips-2.6.0-test2-20030804.macro/arch/i386/kernel/reboot.c linux-mips-2.6.0-test2-20030804/arch/i386/kernel/reboot.c
--- linux-mips-2.6.0-test2-20030804.macro/arch/i386/kernel/reboot.c 2003-06-06 03:57:19.000000000 +0000
+++ linux-mips-2.6.0-test2-20030804/arch/i386/kernel/reboot.c 2003-08-12 14:25:00.000000000 +0000
@@ -248,8 +248,8 @@ void machine_restart(char * __unused)
* Stop all CPUs and turn off local APICs and the IO-APIC, so
* other OSs see a clean IRQ state.
*/
- smp_send_stop();
disable_IO_APIC();
+ smp_send_stop();
#endif

if(!reboot_thru_bios) {
diff -up --recursive --new-file linux-mips-2.6.0-test2-20030804.macro/arch/i386/kernel/smp.c linux-mips-2.6.0-test2-20030804/arch/i386/kernel/smp.c
--- linux-mips-2.6.0-test2-20030804.macro/arch/i386/kernel/smp.c 2003-06-23 03:57:08.000000000 +0000
+++ linux-mips-2.6.0-test2-20030804/arch/i386/kernel/smp.c 2003-08-12 14:22:49.000000000 +0000
@@ -551,6 +551,7 @@ void smp_send_stop(void)

local_irq_disable();
disable_local_APIC();
+ disconnect_bsp_APIC();
local_irq_enable();
}

You should call disconnect_bsp_APIC() just after disable_local_APIC() for
the UP case from your new code as well.
Maciej

--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.039 / U:3.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site