Re: nVidia HPET force enable - merge requirements? (resend)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Thomas Gleixner <tglx@...>
Cc: <linux-kernel@...>, Mikko Tiihonen <mikko.tiihonen@...>, Venkatesh Pallipadi <venkatesh.pallipadi@...>
Date: Friday, October 19, 2007 - 11:29 am

Thomas,

On Friday 19 October 2007 07:50:08 Thomas Gleixner wrote:

Would the following patch be more acceptable then? I've limited the device
id's to just the nForce 4 chipset, because that's the only one I have here
to test with at the moment - it appears to work fine:

hpet clockevent registered
hpet0: at MMIO 0xfefff000, IRQs 2, 8, 31
hpet0: 3 32-bit timers, 25000000 Hz
Time: hpet clocksource has been installed.
Switched to high resolution mode on CPU 0
Switched to high resolution mode on CPU 1

At the moment, I'm not clear on how to detect if the HPET has not been
enabled by the BIOS (but given that this is hidden behind hpet=force,
would this be acceptable, since the user would have to explicitly call
hpet=force, and then it either works or doesn't?)

-Carlos

diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index a4ce191..7c772bf 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -321,6 +321,26 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
 			 vt8237_force_enable_hpet);
 
+static void nvidia_force_enable_hpet(struct pci_dev *dev)
+{
+	u32 uninitialized_var(val);
+
+	if (!hpet_force_user || hpet_address || force_hpet_address)
+		return;
+
+	pci_read_config_dword(dev, 0x44, &val);
+	force_hpet_address = val;
+	printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n",
+	       force_hpet_address);
+	cached_dev = dev;
+	return;
+}
+
+/* ISA Bridge */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0050,
+			 nvidia_force_enable_hpet);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0051,
+			 nvidia_force_enable_hpet);
 
 void force_hpet_resume(void)
 {
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
nVidia HPET force enable - merge requirements? (resend), Carlos Corbacho, (Thu Oct 18, 11:23 pm)
Re: nVidia HPET force enable - merge requirements? (resend), Thomas Gleixner, (Fri Oct 19, 2:50 am)
Re: nVidia HPET force enable - merge requirements? (resend), Carlos Corbacho, (Fri Oct 19, 11:29 am)
Re: nVidia HPET force enable - merge requirements? (resend), Thomas Gleixner, (Fri Oct 19, 12:19 pm)
[PATCH] x86: Force enable HPET for CK804 (nForce 4) chipsets, Carlos Corbacho, (Fri Oct 19, 1:51 pm)
[PATCH] x86: Fix resume for nVidia and force_hpet, Carlos Corbacho, (Fri Oct 19, 2:07 pm)
Re: [PATCH] x86: Fix resume for nVidia and force_hpet, Thomas Gleixner, (Fri Oct 19, 2:15 pm)
x86: Add HPET force support for MCP55 (nForce 5) chipsets, Carlos Corbacho, (Fri Oct 19, 2:34 pm)