login
Header Space

 
 

[PATCH] x86: GEODE: cache results from geode_has_vsa2() and uninline

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: H. Peter Anvin <hpa@...>, Ingo Molnar <mingo@...>, <linux-kernel@...>, <jordan.crouse@...>
Date: Tuesday, April 29, 2008 - 1:32 am

On Mon, 28 Apr 2008 20:06:51 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:


How about this?






This moves geode_has_vsa2 into a .c file, caches the result we get from
the VSA virtual registers, and causes the function to no longer be inline.

Signed-off-by: Andres Salomon <dilinger@debian.org>
---
 arch/x86/kernel/geode_32.c |   19 +++++++++++++++++++
 include/asm-x86/geode.h    |   11 +----------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/geode_32.c b/arch/x86/kernel/geode_32.c
index 9dad6ca..1cb8225 100644
--- a/arch/x86/kernel/geode_32.c
+++ b/arch/x86/kernel/geode_32.c
@@ -161,6 +161,25 @@ void geode_gpio_setup_event(unsigned int gpio, int pair, int pme)
 }
 EXPORT_SYMBOL_GPL(geode_gpio_setup_event);
 
+static int has_vsa2 = -1;
+
+int geode_has_vsa2(void)
+{
+	if (has_vsa2 == -1) {
+		/*
+		 * The VSA has virtual registers that we can query for a
+		 * signature.
+		 */
+		outw(VSA_VR_UNLOCK, VSA_VRC_INDEX);
+		outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX);
+
+		has_vsa2 = (inw(VSA_VRC_DATA) == VSA_SIG);
+	}
+
+	return has_vsa2;
+}
+EXPORT_SYMBOL_GPL(geode_has_vsa2);
+
 static int __init geode_southbridge_init(void)
 {
 	if (!is_geode())
diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h
index 7154dc4..8a53bc8 100644
--- a/include/asm-x86/geode.h
+++ b/include/asm-x86/geode.h
@@ -185,16 +185,7 @@ static inline int is_geode(void)
 	return (is_geode_gx() || is_geode_lx());
 }
 
-/*
- * The VSA has virtual registers that we can query for a signature.
- */
-static inline int geode_has_vsa2(void)
-{
-	outw(VSA_VR_UNLOCK, VSA_VRC_INDEX);
-	outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX);
-
-	return (inw(VSA_VRC_DATA) == VSA_SIG);
-}
+extern int geode_has_vsa2(void);
 
 /* MFGPTs */
 
-- 
1.5.5

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

Messages in current thread:
2.6.25-mm1, Andrew Morton, (Fri Apr 18, 4:47 am)
[Was: 2.6.25-mm1], Jiri Slaby, (Mon Apr 21, 4:31 am)
Re: [Was: 2.6.25-mm1], Al Viro, (Mon Apr 21, 5:06 am)
fault in __d_lookup [Was: 2.6.25-mm1], Jiri Slaby, (Mon Apr 21, 5:37 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1], Al Viro, (Mon Apr 21, 5:45 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1], Jiri Slaby, (Mon Apr 21, 5:59 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1], Matthew Wilcox, (Mon Apr 21, 1:23 pm)
Re: fault in __d_lookup [Was: 2.6.25-mm1], Rafael J. Wysocki, (Mon Apr 21, 9:42 am)
internal compiler error: SIGSEGV [Was: 2.6.25-mm1], Jiri Slaby, (Sun Apr 20, 7:29 am)
Re: 2.6.25-mm1, Joseph Fannin, (Fri Apr 18, 11:10 pm)
Re: 2.6.25-mm1, Andrew Morton, (Fri Apr 18, 11:29 pm)
Re: 2.6.25-mm1, Arjan van de Ven, (Sat Apr 19, 2:21 pm)
Re: 2.6.25-mm1, Andres Salomon, (Sat Apr 19, 9:25 am)
Re: 2.6.25-mm1, Andrew Morton, (Sat Apr 19, 1:38 pm)
Re: 2.6.25-mm1, Andres Salomon, (Sat Apr 19, 1:50 pm)
Re: 2.6.25-mm1, Jordan Crouse, (Mon Apr 21, 10:56 am)
Re: 2.6.25-mm1, Andres Salomon, (Mon Apr 21, 11:05 am)
Re: 2.6.25-mm1, Jordan Crouse, (Mon Apr 21, 11:12 am)
[PATCH 2/2] OLPC: drop pre-OpenFirmware workarounds, Andres Salomon, (Sat Apr 19, 1:39 pm)
[PATCH] x86: GEODE: cache results from geode_has_vsa2() and ..., Andres Salomon, (Tue Apr 29, 1:32 am)
Re: OLPC: only check for OFW signature on VSA-less Geodes, Jordan Crouse, (Mon Apr 21, 5:17 pm)
Re: OLPC: Add support for calling into Open Firmware, Jordan Crouse, (Mon Apr 21, 11:05 am)
Re: OLPC: Add support for calling into Open Firmware, H. Peter Anvin, (Mon Apr 21, 10:58 am)
Re: 2.6.25-mm1, Joseph Fannin, (Fri Apr 18, 10:25 pm)
Re: 2.6.25-mm1, Andrew Morton, (Fri Apr 18, 11:08 pm)
Re: 2.6.25-mm1, Joseph Fannin, (Fri Apr 18, 10:13 pm)
Re: 2.6.25-mm1, Andrew Morton, (Fri Apr 18, 11:02 pm)
Re: 2.6.25-mm1, Dmitry Torokhov, (Sat Apr 19, 12:14 am)
Re: 2.6.25-mm1, Andrew Morton, (Sat Apr 19, 12:29 am)
Re: 2.6.25-mm1, Takashi Iwai, (Mon Apr 21, 10:06 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Mon Apr 21, 1:55 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Tue Apr 22, 6:13 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Tue Apr 22, 2:31 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Wed Apr 23, 4:49 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Wed Apr 23, 4:02 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Thu Apr 24, 5:40 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Thu Apr 24, 11:51 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Fri Apr 25, 2:28 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Fri Apr 25, 12:45 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Dmitry Torokhov, (Fri Apr 25, 2:09 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Fri Apr 25, 2:31 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Dmitry Torokhov, (Fri Apr 25, 2:37 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Fri Apr 25, 12:51 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Fri May 2, 12:44 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Fri May 2, 12:57 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Tue May 6, 6:20 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Tue May 6, 12:51 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Fri Apr 25, 1:25 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Takashi Iwai, (Wed Apr 23, 10:18 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Dmitry Torokhov, (Tue Apr 22, 10:01 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC), Stas Sergeev, (Tue Apr 22, 12:42 pm)
Re: 2.6.25-mm1, Takashi Iwai, (Mon Apr 21, 7:07 am)
Re: 2.6.25-mm1, Stas Sergeev, (Mon Apr 21, 3:45 pm)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict), Stas Sergeev, (Mon Apr 21, 1:44 pm)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict), Takashi Iwai, (Tue Apr 22, 6:09 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict), Stas Sergeev, (Tue Apr 22, 1:54 pm)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict), Takashi Iwai, (Wed Apr 23, 4:55 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict), Takashi Iwai, (Wed Apr 23, 10:14 am)
Re: 2.6.25-mm1, Joseph Fannin, (Sat Apr 19, 2:33 am)
2.6.25-mm1: orphaned files after build, Alexey Dobriyan, (Fri Apr 18, 7:09 pm)
Re: 2.6.25-mm1, , (Fri Apr 18, 4:14 pm)
Re: 2.6.25-mm1 (build error: trace selftest), Randy Dunlap, (Fri Apr 18, 12:45 pm)
Re: 2.6.25-mm1 (build error: driver core), Randy Dunlap, (Fri Apr 18, 12:40 pm)
Re: 2.6.25-mm1 (build error: driver core), Greg KH, (Fri Apr 18, 12:56 pm)
Re: 2.6.25-mm1 (build error: driver core), Dan Williams, (Fri Apr 18, 2:38 pm)
StackProtector Oopses - Re: 2.6.25-mm1, Reuben Farrelly, (Fri Apr 18, 9:02 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Ingo Molnar, (Fri Apr 18, 9:36 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Reuben Farrelly, (Fri Apr 18, 10:49 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Ingo Molnar, (Mon Apr 21, 11:06 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Arjan van de Ven, (Mon Apr 21, 9:48 pm)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Ingo Molnar, (Tue Apr 22, 4:34 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Arjan van de Ven, (Tue Apr 22, 10:29 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Arjan van de Ven, (Fri Apr 18, 9:51 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1, Reuben Farrelly, (Fri Apr 18, 10:41 am)
speck-geostationary