LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Prakash Punnoor <prakash@punnoor.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>,
	mingo@elte.hu, lenb@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Replace nvidia timer override quirk with pci id list
Date: Sat, 9 Feb 2008 13:18:52 +0100	[thread overview]
Message-ID: <200802091318.53249.prakash@punnoor.de> (raw)
In-Reply-To: <alpine.LFD.1.00.0802091140170.3145@apollo.tec.linutronix.de>

[-- Attachment #1: Type: text/plain, Size: 6214 bytes --]

On the day of Saturday 09 February 2008 Thomas Gleixner hast written:
> On Sat, 9 Feb 2008, Prakash Punnoor wrote:
> > On the day of Friday 08 February 2008 Andi Kleen hast written:
> > > On Fri, Feb 08, 2008 at 08:00:39PM +0100, Prakash Punnoor wrote:
> > > > On the day of Friday 08 February 2008 Andi Kleen hast written:
> > > > > On Fri, Feb 08, 2008 at 06:39:17PM +0100, Prakash Punnoor wrote:
> > > > > > Yes, confirmed. timer w/o the skipping stays XT-PIC on nforce2.
> > > > >
> > > > > Confirmed what? Did you test my patch on both machines?
> > > > > What was the result?
> > > >
> > > > I confirmed that it (nforce2) needed the acpi_skip_timer_override. If
> > > > you read my mail, you knew I didn't test your patch.
> > >
> > > Ok can you please do so then?  Or stop your obstructism?
> >
> > Grr, I don't know why I am discussing with stubborn and/or arrogant devs
> > like you seem to be. But I actually did what you wanted and as *expected*
> > - as I said I understand that trivial piece of code you posted - your
> > patch fails here for my nforce2:
>
> No worry, this patch wont go anywhere near mainline as long as it
> breaks stuff and obviously you are under no obligation to re-test
> patches that have not been changed just re-submitted.

The problem is current behaviour is already broken as it applies the quirk 
*unconditionally* for all Nvidia hardwarde where no hpet is detected. The 
latter is just heuristics. *If* correct Nforce2 ID gets added to the proposed 
patch, behaviour would be equivalent to current situation for me (nforce2, 
mcp51). Still I am saying mcp51 doesn't belong per-se to the list of chipsets 
which need to be quirked, as for me it shows adverse effect. Taking mcp51 out 
would be an advancement.


If there are situations where quirking is correct and other situation where it 
is incorrect for the same type of chipsets, I think then the quirk should not 
be applied automatically.



So I suggest something like this as a start. The quirk only gets applied for 
nforce2 unconditionally, as it was intended originally. For chipsets between 
nforce3 and before nforce5 the user gets a message and no quirk gets applied 
automatically. If there are known bug reports (Andi Kleen didn't supply any 
references) some more infos could be asked from the reportes. Then for known 
broken bios versions the quirk could be applied by DMI scan *selectively*. 
(This part of code is missing here.) I also don't know whether the list of 
IDs is complete.

Warning I hand edited the original proposed patch, so it won't apply and 
probably won't compile. But I hope one gets the idea.


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.
+        * Timer overrides on Nvidia NForce2 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 "NForce2 Nvidia 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);
 };
 
+ static void __init nvidia_timer_hint(int num, int slot, int func)
+ {
+ 	if (!acpi_skip_timer_override)
+ 		printk(KERN_INFO "Pre NForce5 Nvidia board detected."
+				 "If you have trouble, try booting with acpi_skip_timer_override\n"
+				 "If that works for you please report to the Linux kernel mailing 
list.");
+ }

+#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, PCI_DEVICE_ID_NVIDIA_NFORCE2, 
nvidia_timer),
+       QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x00e1, nvidia_timer_hint), /* nforce 3 
*/
+       QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x00ed, nvidia_timer_hint), /* nforce 3 
*/
+       QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x003d, nvidia_timer_hint), /* mcp 04 ?? 
*/
+       QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x02f0, nvidia_timer_hint), /* mcp 
51/nf4 ? */
+       QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x026f, nvidia_timer_hint), /* mcp 
51/nf4 ? */
+       QBRIDGE(PCI_VENDOR_ID_NVIDIA, 0x005c, nvidia_timer_hint), /* 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,


-- 
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-02-09 12:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 19:55 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 [this message]
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

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=200802091318.53249.prakash@punnoor.de \
    --to=prakash@punnoor.de \
    --cc=andi@firstfloor.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH] Replace nvidia timer override quirk with pci id list' \
    /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

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).