public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH] ACPI :Modify timer override connection in Some NVIDIA systems
@ 2007-10-12  7:04 Zhao Yakui
  2007-10-15 16:30 ` Chuck Ebbert
  0 siblings, 1 reply; 9+ messages in thread
From: Zhao Yakui @ 2007-10-12  7:04 UTC (permalink / raw)
  To: Linux-acpi; +Cc: lenb

Hi, All
    The BIOS of some systems using NVIDIA chipset gives the uncorrect
timer override connection, which will cause that I/O APIC and timer
can't be connected and kernel panic.
    There are two ways to fix this bug. One is to use the following patch and 
the other is to add a new boot option of acpi_force_timer_override. 

1. Use the following patch.
The basic flowchart of patch is that:(unnecessary to add new boot option)
    a. When NVIDIA chipset is detected and hpet timer exist, 
acpi_use_timer_override will be set.
    (Skip this when boot option of acpi_use_timer_override is given).
    b. Check whether uncorrect timer connection(IRQ0, Pin0) exists when 
acpi_use_timer_override is set and HPET timer exists. 
      If error exists, timer will be forced to route to the Pin2.

2. Add a new boot option of acpi_force_timer_override
    The basic flowchart of this method is that:
    a. When NVIDIA chipset is detected and HPET timer exists, 
acpi_force_timer_override will be set.
       (skip this when boot option of acpi_force_timer_override is given)
    b. Check whether uncorrect timer connection(IRQ0,Pin0) exists when 
acpi_force_timer_override is set.
       If the error exists, modify the timer override connection.

Welcome the comments.
Thanks.

Subject: ACPI :Modify timer override connection in Some NVIDIA systems
>From : Zhao Yakui <yakui.zhao@intel.com>

BIOS defines the uncorrect timeroverride connection in some NVIDIA
systems
on which HPET timer exists. When the uncorrect connection is deteced, 
the timer will be forced to route to the Pin 2 of I/O APIC instead of
Pin 0.

http://bugzilla.kernel.org/show_bug.cgi?id=8956

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
---
 arch/i386/kernel/acpi/boot.c       |   17 +++++++++++++++++
 arch/i386/kernel/acpi/earlyquirk.c |    7 ++++++-
 arch/x86_64/kernel/early-quirks.c  |    2 ++
 3 files changed, 25 insertions(+), 1 deletion(-)

Index: linux-2.6.23-rc9/arch/i386/kernel/acpi/boot.c
===================================================================
--- linux-2.6.23-rc9.orig/arch/i386/kernel/acpi/boot.c
+++ linux-2.6.23-rc9/arch/i386/kernel/acpi/boot.c
@@ -351,6 +351,11 @@ static void __init acpi_sci_ioapic_setup
 	return;
 }
 
+static int __init acpi_hpet_check(struct acpi_table_header *header)
+{
+	return 0;
+}
+
 static int __init
 acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
 		       const unsigned long end)
@@ -371,6 +376,18 @@ acpi_parse_int_src_ovr(struct acpi_subta
 		return 0;
 	}
 
+	if (acpi_use_timer_override &&
+	   intsrc->source_irq == 0 && intsrc->global_irq == 0 &&
+	   !acpi_table_parse(ACPI_SIG_HPET, acpi_hpet_check)) {
+		mp_override_legacy_irq(intsrc->source_irq,
+			intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,
+			(intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2,
+			2);
+		printk(PREFIX "BIOS IRQ0 pin0 override ignored."
+				"Force to use IRQ0 pin2 \n");
+		return 0;
+	}
+
 	if (acpi_skip_timer_override &&
 	    intsrc->source_irq == 0 && intsrc->global_irq == 2) {
 		printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
Index: linux-2.6.23-rc9/arch/i386/kernel/acpi/earlyquirk.c
===================================================================
--- linux-2.6.23-rc9.orig/arch/i386/kernel/acpi/earlyquirk.c
+++ linux-2.6.23-rc9/arch/i386/kernel/acpi/earlyquirk.c
@@ -26,7 +26,8 @@ static int __init check_bridge(int vendo
 	/* According to Nvidia all timer overrides are bogus unless HPET
 	   is enabled. */
 	if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) {
-		if (!warned && acpi_table_parse(ACPI_SIG_HPET,
+		if (!warned) {
+		if (acpi_table_parse(ACPI_SIG_HPET,
 						nvidia_hpet_check)) {
 			warned = 1;
 			acpi_skip_timer_override = 1;
@@ -36,6 +37,10 @@ static int __init check_bridge(int vendo
                 printk(KERN_INFO "If you got timer trouble "
 			 	 "try acpi_use_timer_override\n");
 
+			} else {
+			warned = 1;
+			acpi_use_timer_override = 1;
+			}
 		}
 	}
 #endif
Index: linux-2.6.23-rc9/arch/x86_64/kernel/early-quirks.c
===================================================================
--- linux-2.6.23-rc9.orig/arch/x86_64/kernel/early-quirks.c
+++ linux-2.6.23-rc9/arch/x86_64/kernel/early-quirks.c
@@ -57,6 +57,8 @@ static void __init nvidia_bugs(void)
 		       "timer override.\n");
 		printk(KERN_INFO "If you got timer trouble "
 			"try acpi_use_timer_override\n");
+	} else {
+		acpi_use_timer_override = 1;
 	}
 #endif
 	/* RED-PEN skip them on mptables too? */

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-10-17  9:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12  7:04 [RFC] [PATCH] ACPI :Modify timer override connection in Some NVIDIA systems Zhao Yakui
2007-10-15 16:30 ` Chuck Ebbert
2007-10-15 16:32   ` Andi Kleen
2007-10-16 21:07     ` Chuck Ebbert
2007-10-16 21:51       ` Andi Kleen
2007-10-16 21:57         ` Chuck Ebbert
2007-10-16 22:17           ` Andi Kleen
2007-10-17  9:00         ` Zhao Yakui
2007-10-17  9:58           ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox