Skip to contentSkip to conversation

Fix HPET operation on 64-bit NVIDIA platforms

PATCH In review [email protected] 3 participants 3 messages Jun 2, 2006 – Jun 6, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 12/13 Fix HPET operation on 64-bit NVIDIA platforms

From: "Andy Currid" <[email protected]>

This patch fixes a kernel panic during boot that occurs on NVIDIA platforms that have HPET enabled.

When HPET is enabled, the standard timer IRQ is routed to IOAPIC pin 2 and is advertised as such in the ACPI APIC table - but an earlier workaround in the kernel was ignoring this override. The fix is to honor timer IRQ overrides from ACPI when HPET is detected on an NVIDIA platform.

Cc "Brown, Len" <[email protected]>
Cc "Yu, Luming" <[email protected]>
Cc Andi Kleen <[email protected]>

---

 arch/x86_64/kernel/io_apic.c |   30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)
arch/x86_64/kernel/io_apic.c renamed from arch/x86_64/kernel/io_apic.c~fix-hpet-operation-on-64-bit-nvidia-platforms +25 -5
diff -puN arch/x86_64/kernel/io_apic.c~fix-hpet-operation-on-64-bit-nvidia-platforms arch/x86_64/kernel/io_apic.c
@@ -271,6 +271,18 @@ __setup("enable_8254_timer", setup_enabl
 #include <linux/pci_ids.h>
 #include <linux/pci.h>
 
+
+#ifdef CONFIG_ACPI
+
+static int nvidia_hpet_detected __initdata;
+
+static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
+{
+	nvidia_hpet_detected = 1;
+	return 0;
+}
+#endif
+
 /* Temporary Hack. Nvidia and VIA boards currently only work with IO-APIC
    off. Check for an Nvidia or VIA PCI bridge and turn it off.
    Use pci direct infrastructure because this runs before the PCI subsystem. 
@@ -317,11 +329,19 @@ void __init check_ioapic(void) 
 					return;
 				case PCI_VENDOR_ID_NVIDIA:
 #ifdef CONFIG_ACPI
-					/* All timer overrides on Nvidia
-				           seem to be wrong. Skip them. */
-					acpi_skip_timer_override = 1;
-					printk(KERN_INFO 
-	     "Nvidia board detected. Ignoring ACPI timer override.\n");
+					/*
+					 * All timer overrides on Nvidia are
+					 * wrong unless HPET is enabled.
+					 */
+					nvidia_hpet_detected = 0;
+					acpi_table_parse(ACPI_HPET,
+							nvidia_hpet_check);
+					if (nvidia_hpet_detected == 0) {
+						acpi_skip_timer_override = 1;
+						printk(KERN_INFO "Nvidia board "
+						    "detected. Ignoring ACPI "
+						    "timer override.\n");
+					}
 #endif
 					/* RED-PEN skip them on mptables too? */
 					return;

_

#1 lore raw
Quoted 4 lines

#ifdef CONFIG_ACPI

arch/x86_64/kernel/io_apic.c renamed from arch/x86_64/kernel/io_apic.c~fix-hpet-operation-on-64-bit-nvidia-platforms +0 -2
-					/* All timer overrides on Nvidia
-				           seem to be wrong. Skip them. */

arch/x86_64/kernel/io_apic.c void __init check_ioapic(void) · line 338

Quoted 10 lines
arch/x86_64/kernel/io_apic.c renamed from arch/x86_64/kernel/io_apic.c~fix-hpet-operation-on-64-bit-nvidia-platforms +7 -3
-					acpi_skip_timer_override = 1;
-					printk(KERN_INFO 
-	     "Nvidia board detected. Ignoring ACPI timer override.\n");
+					/*
+					 * All timer overrides on Nvidia are
+					 * wrong unless HPET is enabled.
+					 */
+					nvidia_hpet_detected = 0;
+					acpi_table_parse(ACPI_HPET,
+							nvidia_hpet_check);

I'm not sure it's safe to call acpi_table_parse() when the user passed acpi=off

Better would be probably to set a flag in the HPET callback in arch/i386/kernel/acpi/boot.c

-Andi

#2 lore raw
In reply to [email protected]

Hi,
I experience this "kernel panic during boot" with acpi=off and IIRC pci=noacpi, but what I like to know if this can resolve any other problems on my bug: http://bugzilla.kernel.org/show_bug.cgi?id=6419
http://bugzilla.kernel.org/show_bug.cgi?id=6419#c17

btw I will try this patch anyway
Thanks,

Quoted 72 lines · On Thu, 2006-06-01 at 20:18 -0700, [email protected] wrote:

From: "Andy Currid" <[email protected]>

This patch fixes a kernel panic during boot that occurs on NVIDIA platforms that have HPET enabled.

When HPET is enabled, the standard timer IRQ is routed to IOAPIC pin 2 and is advertised as such in the ACPI APIC table - but an earlier workaround in the kernel was ignoring this override. The fix is to honor timer IRQ overrides from ACPI when HPET is detected on an NVIDIA platform.

Cc "Brown, Len" <[email protected]>
Cc "Yu, Luming" <[email protected]>
Cc Andi Kleen <[email protected]>

---

 arch/x86_64/kernel/io_apic.c |   30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff -puN arch/x86_64/kernel/io_apic.c~fix-hpet-operation-on-64-bit-nvidia-platforms arch/x86_64/kernel/io_apic.c

arch/x86_64/kernel/io_apic.c renamed from arch/x86_64/kernel/io_apic.c~fix-hpet-operation-on-64-bit-nvidia-platforms +25 -5
@@ -271,6 +271,18 @@ __setup("enable_8254_timer", setup_enabl
 #include <linux/pci_ids.h>
 #include <linux/pci.h>
 
+
+#ifdef CONFIG_ACPI
+
+static int nvidia_hpet_detected __initdata;
+
+static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
+{
+	nvidia_hpet_detected = 1;
+	return 0;
+}
+#endif
+
 /* Temporary Hack. Nvidia and VIA boards currently only work with IO-APIC
    off. Check for an Nvidia or VIA PCI bridge and turn it off.
    Use pci direct infrastructure because this runs before the PCI subsystem. 
@@ -317,11 +329,19 @@ void __init check_ioapic(void) 
 					return;
 				case PCI_VENDOR_ID_NVIDIA:
 #ifdef CONFIG_ACPI
-					/* All timer overrides on Nvidia
-				           seem to be wrong. Skip them. */
-					acpi_skip_timer_override = 1;
-					printk(KERN_INFO 
-	     "Nvidia board detected. Ignoring ACPI timer override.\n");
+					/*
+					 * All timer overrides on Nvidia are
+					 * wrong unless HPET is enabled.
+					 */
+					nvidia_hpet_detected = 0;
+					acpi_table_parse(ACPI_HPET,
+							nvidia_hpet_check);
+					if (nvidia_hpet_detected == 0) {
+						acpi_skip_timer_override = 1;
+						printk(KERN_INFO "Nvidia board "
+						    "detected. Ignoring ACPI "
+						    "timer override.\n");
+					}
 #endif
 					/* RED-PEN skip them on mptables too? */
 					return;

_
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html