LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Replace nvidia timer override quirk with pci id list
@ 2008-02-07 19:55 Andi Kleen
  2008-02-07 21:21 ` Prakash Punnoor
  0 siblings, 1 reply; 28+ messages in thread
From: Andi Kleen @ 2008-02-07 19:55 UTC (permalink / raw)
  To: mingo, tglx, lenb, linux-kernel

[This patch was originally in the old ff tree and was intended for .24; but
somehow got lost in the arch merge. Has also shipped with OpenSUSE 10.3.
I think it should go into .25] 

This replaces the old NF3/NF4 reference BIOS timer override quirk with a device 
ID list. We need to ignore the timer override on these systems, but not 
ignore it on NF5 based systems. Previously this was distingushed by checking
for HPET, but a lot of BIOS vendors didn't enable HPET in their pre Vista 
BIOSes.

Replace the old "for all of nvidia" quirk with a quirk containing pci device
ID. I goobled this list together from pci.ids and googling and it may be 
incomplete, but so far I haven't had complaints.

Cc: lenb@kernel.org

Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86/kernel/early-quirks.c |   43 ++++++++++++++++-------------------------
 1 file changed, 17 insertions(+), 26 deletions(-)

Index: linux/arch/x86/kernel/early-quirks.c
===================================================================
--- linux.orig/arch/x86/kernel/early-quirks.c
+++ linux/arch/x86/kernel/early-quirks.c
@@ -60,38 +60,21 @@ static void __init via_bugs(int  num, in
 #endif
 }
 
-#ifdef CONFIG_ACPI
-#ifdef CONFIG_X86_IO_APIC
-
-static int __init nvidia_hpet_check(struct acpi_table_header *header)
-{
-	return 0;
-}
-#endif /* CONFIG_X86_IO_APIC */
-#endif /* CONFIG_ACPI */
-
-static void __init nvidia_bugs(int num, int slot, int func)
+static void __init nvidia_timer(int num, int slot, int func)
 {
 #ifdef CONFIG_ACPI
 #ifdef CONFIG_X86_IO_APIC
 	/*
-	 * All timer overrides on Nvidia are
-	 * wrong unless HPET is enabled.
-	 * Unfortunately that's not true on many Asus boards.
-	 * We don't know yet how to detect this automatically, but
-	 * at least allow a command line override.
+	 * All timer overrides on Nvidia NF3/NF4 are
+	 * wrong.
 	 */
 	if (acpi_use_timer_override)
 		return;
 
-	if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check)) {
-		acpi_skip_timer_override = 1;
-		printk(KERN_INFO "Nvidia board "
-		       "detected. Ignoring ACPI "
-		       "timer override.\n");
-		printk(KERN_INFO "If you got timer trouble "
-			"try acpi_use_timer_override\n");
-	}
+	acpi_skip_timer_override = 1;
+	printk(KERN_INFO "Pre NForce5 vidia board detected."
+		         "Ignoring ACPI timer override.\n");
+	printk(KERN_INFO "If you have trouble try acpi_use_timer_override\n");
 #endif
 #endif
 	/* RED-PEN skip them on mptables too? */
@@ -121,9 +104,19 @@ struct chipset {
 	void (*f)(int num, int slot, int func);
 };
 
+#define QBRIDGE(vendor, device, func) { \
+	vendor, device, PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, \
+	QFLAG_APPLY_ONCE, func }
+
 static struct chipset early_qrk[] __initdata = {
-	{ PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
-	  PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs },
+	/* This list should cover at least one PCI ID from each NF3 or NF4
+	   mainboard to handle a bug in their reference BIOS. */
+	QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x00e1, nvidia_timer), /* nforce 3 */
+	QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x00ed, nvidia_timer), /* nforce 3 */
+	QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x003d, nvidia_timer), /* mcp 04 ?? */
+	QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x02f0, nvidia_timer), /* mcp 51/nf4 ? */
+	QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x026f, nvidia_timer), /* mcp 51/nf4 ? */
+	QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x005c, nvidia_timer), /* ck 804 */
 	{ PCI_VENDOR_ID_VIA, PCI_ANY_ID,
 	  PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, via_bugs },
 	{ PCI_VENDOR_ID_ATI, PCI_ANY_ID,

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

end of thread, other threads:[~2010-01-29  8:32 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-07 19:55 [PATCH] Replace nvidia timer override quirk with pci id list Andi Kleen
2008-02-07 21:21 ` Prakash Punnoor
2008-02-08 11:36   ` Andi Kleen
2008-02-08 15:13     ` Prakash Punnoor
2008-02-08 15:18       ` Prakash Punnoor
2008-02-08 16:09       ` Andi Kleen
2008-02-08 17:39         ` Prakash Punnoor
2008-02-08 19:01           ` Andi Kleen
2008-02-08 19:00             ` Prakash Punnoor
2008-02-08 21:02               ` Andi Kleen
2008-02-08 23:08                 ` Prakash Punnoor
2008-02-09 11:06                   ` Thomas Gleixner
2008-02-09 12:18                     ` Prakash Punnoor
2008-02-09 11:59                   ` Andi Kleen
2008-02-09 11:53                     ` Prakash Punnoor
2008-02-09 14:31                       ` Andi Kleen
2008-02-09 15:51                         ` Prakash Punnoor
2008-02-09 16:56                           ` Andi Kleen
2008-02-09 17:30                             ` Prakash Punnoor
2008-02-09 12:17                   ` [PATCH] Replace nvidia timer override quirk with pci id list II Andi Kleen
2010-01-29  8:32               ` [PATCH] Replace nvidia timer override quirk with pci id list Yuhong Bao
2008-02-09 12:46           ` Gene Heskett
2008-02-09 14:18             ` Andi Kleen
2008-02-09 14:03               ` Alan Cox
2008-02-09 18:02               ` Gene Heskett
2008-02-09 18:11                 ` Prakash Punnoor
2008-02-09 20:05                   ` Gene Heskett
2008-02-09 21:13                     ` Prakash Punnoor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).