[PATCH 2/2] x86: GEODE add the "mfgptfix" boot time option to fix MFGPT timers

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Arnd Hannemann <hannemann@...>, Jordan Crouse <jordan.crouse@...>, Lars Heete <hel@...>, Andres Salomon <dilinger@...>, Linux Kernel Mailing List <linux-kernel@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>
Date: Wednesday, January 23, 2008 - 5:19 pm

The new "mfgptfix" boot command line option may be usd to fix MFGPT
timers on AMD Geode platforms when the BIOS has incorrectly applied
a workaround. TinyBIOS version 0.98 is known to be affected, 0.99
fixes the problem by letting the user disable the workaround.

Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 Documentation/kernel-parameters.txt |    5 +++++
 arch/x86/kernel/mfgpt_32.c          |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c417877..83c6704 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1051,6 +1051,11 @@ and is between 256 and 4096 characters. It is defined in the file
 			Multi-Function General Purpose Timers on AMD Geode
 			platforms.
 
+	mfgptfix	[X86-32] Fix MFGPT timers on AMD Geode platforms when
+			the BIOS has incorrectly applied a workaround. TinyBIOS
+			version 0.98 is known to be affected, 0.99 fixes the
+			problem by letting the user disable the workaround.
+
 	mga=		[HW,DRM]
 
 	mousedev.tap_time=
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 5519091..f38d4a9 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -63,6 +63,21 @@ static int __init mfgpt_disable(char *s)
 }
 __setup("nomfgpt", mfgpt_disable);
 
+/* Reset the MFGPT timers. This is required by some broken BIOSes which already
+ * do the same and leave the system in an unstable state. TinyBIOS 0.98 is
+ * affected at least (0.99 is OK with MFGPT workaround left to off).
+ */
+static int __init mfgpt_fix(char *s)
+{
+	u32 val, dummy;
+
+	/* The following udocumented bit resets the MFGPT timers */
+	val = 0xFF; dummy = 0;
+	wrmsr(0x5140002B, val, dummy);
+	return 1;
+}
+__setup("mfgptfix", mfgpt_fix);
+
 /*
  * Check whether any MFGPTs are available for the kernel to use.  In most
  * cases, firmware that uses AMD's VSA code will claim all timers during
-- 
1.5.3.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Wed Jan 16, 1:44 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Wed Jan 16, 5:19 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Wed Jan 16, 5:56 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 5:54 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Thu Jan 17, 2:40 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 3:53 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 5:19 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 5:50 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 6:36 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 6:52 pm)
Re: Geode GX/LX watchdog timer (RESEND), Jordan Crouse, (Mon Jan 21, 1:07 pm)
Re: Geode GX/LX watchdog timer (RESEND), Arnd Hannemann, (Mon Jan 21, 2:37 pm)
Re: Geode GX/LX watchdog timer (RESEND), Iain Paton, (Sun Feb 17, 10:14 am)
Re: Geode GX/LX watchdog timer (RESEND), Arnd Hannemann, (Sun Feb 17, 10:46 am)
Re: Geode GX/LX watchdog timer (RESEND), Adrian Bunk, (Sun Feb 17, 10:54 am)
Re: Geode GX/LX watchdog timer (RESEND), Iain Paton, (Sun Feb 17, 12:10 pm)
Re: Geode GX/LX watchdog timer (RESEND), Arnd Hannemann, (Sun Feb 17, 3:46 pm)
Re: Geode GX/LX watchdog timer (RESEND), Andres Salomon, (Sun Feb 17, 1:32 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 6:57 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 7:39 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Mon Jan 21, 7:27 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Tue Jan 22, 5:03 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Lars Heete, (Tue Jan 22, 6:11 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Tue Jan 22, 7:18 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Tue Jan 22, 3:27 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Tue Jan 22, 4:54 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Ingo Molnar, (Tue Jan 22, 5:10 pm)
[PATCH 0/2] Was: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Wed Jan 23, 5:17 pm)
[PATCH 2/2] x86: GEODE add the "mfgptfix" boot time option t..., Willy Tarreau, (Wed Jan 23, 5:19 pm)
[PATCH 1/2] x86: GEODE fix MFGPT input clock value, Willy Tarreau, (Wed Jan 23, 5:18 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, H. Peter Anvin, (Wed Jan 23, 5:59 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, Willy Tarreau, (Wed Jan 23, 6:11 pm)
Re: x86: GEODE fix MFGPT input clock value, Jordan Crouse, (Wed Jan 23, 6:38 pm)
Re: x86: GEODE fix MFGPT input clock value, Arnd Hannemann, (Wed Jan 23, 7:17 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, H. Peter Anvin, (Wed Jan 23, 6:22 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, Willy Tarreau, (Wed Jan 23, 6:10 pm)
[git pull] was: Re: 2.6.24-rc8 hangs at mfgpt-timer, Thomas Gleixner, (Tue Jan 22, 5:53 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Tue Jan 22, 5:20 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Tue Jan 22, 2:15 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Mon Jan 21, 7:32 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Tue Jan 22, 4:15 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Tue Jan 22, 5:08 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Tue Jan 22, 5:15 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Wed Jan 23, 12:36 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Wed Jan 23, 12:10 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 8:40 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Thu Jan 17, 4:42 pm)