mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <willy@w.ods.org>
To: davej@redhat.com, marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH-2.4] Disable APIC on reboot.
Date: Mon, 11 Aug 2003 17:33:53 +0200	[thread overview]
Message-ID: <20030811153353.GA2751@alpha.home.local> (raw)
In-Reply-To: <E19mCuO-0003dI-00@tetrachloride>

Marcelo,

This patch allows my VAIO to reboot with LOCAL_APIC enabled. I too have a
broken BIOS which cannot put hardware into a sane state at boot, and it hangs
on IDE detection if the kernel left LOCAL_APIC enabled. Now with this patch
upon 2.4.22-rc2, it's OK, so I can enable LOCAL_APIC again. Do you find it too
late for 2.4.22 ? Depending on how we see it, it may be considered as a
workaround for broken BIOSes, or as a bugfix for a kernel which didn't restore
hardware into its original state. Or at least, please accept it for 2.4.23-pre1.

I rediffed it against 2.4.22-rc2, and attached the patch at the end of this
mail.

Cheers,
Willy

On Mon, Aug 11, 2003 at 02:40:24PM +0100, davej@redhat.com wrote:
> Forward port of a patch from Felix [surname mangled by MTA] <fxkuehl@gmx.de>
> 
> Original mail:-
> 
> when I reboot my laptop the BIOS complains about a keyboard controller
> failure and timer interrupts not working. On the BIOS password screen
> the keyboard doesn't work. If I disable the BIOS password the system
> hangs a bit later on the POST screen. I tried all reboot methods via the
> kernel command line without success. I saw this problem with Debian
> Woody's precompiled 2.4.18 kernel, self compiled Debian 2.4.20 sources
> and Linux 2.4.21-rc1+ACPI patch. This problem only occurs if
> CONFIG_X86_LOCAL_APIC is enabled. With CONFIG_X86_LOCAL_APIC disabled it
> reboots just fine.
> 
> My guess is that it's a BIOS bug as I've never had this problem on other
> machines before. I found a workaround: disable the local APIC before
> rebooting. I don't really know how it works. Just calling
> disable_local_APIC wasn't enough, so I copied a bit more code from
> apic_pm_suspend (arch/i386/kernel/apic.c:465) to machine_restart
> (arch/i386/kernel/process.c:369). I'm pretty sure that this is not the
> proper way to do it but it works here. A patch against 2.4.21-rc1 can be
> found at the end of this email.
> 

--- linux-2.4.22-rc2/arch/i386/kernel/process.c	Wed Jul 30 09:18:21 2003
+++ linux-2.4.22-rc2-lapic/arch/i386/kernel/process.c	Mon Aug 11 17:18:57 2003
@@ -42,6 +42,7 @@
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/irq.h>
+#include <asm/apic.h>
 #include <asm/desc.h>
 #include <asm/mmu_context.h>
 #ifdef CONFIG_MATH_EMULATION
@@ -400,6 +401,17 @@
 	 */
 	smp_send_stop();
 	disable_IO_APIC();
+#elif CONFIG_X86_LOCAL_APIC
+	{
+		unsigned int l, h;
+
+		local_irq_disable();
+		disable_local_APIC();
+		rdmsr(MSR_IA32_APICBASE, l, h);
+		l &= ~MSR_IA32_APICBASE_ENABLE;
+		wrmsr(MSR_IA32_APICBASE, l, h);
+		local_irq_enable();
+	}
 #endif
 
 	if(!reboot_thru_bios) {


  reply	other threads:[~2003-08-11 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11 13:40 [PATCH] " davej
2003-08-11 15:33 ` Willy Tarreau [this message]
2003-08-11 16:29 ` Mikael Pettersson
2003-08-11 16:38   ` Dave Jones
2003-08-11 16:57     ` Mikael Pettersson
2003-08-11 23:33       ` [PATCH][2.6.0-test3] " Mikael Pettersson
2003-08-12 13:48         ` Maciej W. Rozycki
2003-08-12 13:57           ` Mikael Pettersson
2003-08-12 14:31             ` Maciej W. Rozycki
2003-08-11 23:33       ` [PATCH][2.4.22-rc2] " Mikael Pettersson
2003-08-12  6:09         ` Willy Tarreau
2003-08-15 19:22         ` Marc-Christian Petersen
2003-08-27  7:19         ` Luca Montecchiani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030811153353.GA2751@alpha.home.local \
    --to=willy@w.ods.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®