All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattia Dongili <malattia@linux.it>
To: CPUFreq Mailing List <cpufreq@lists.linux.org.uk>
Cc: Eric Piel <eric.piel@tremplin-utc.net>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	davej@redhat.com
Subject: [PATCH 1/2] Move PMBASE reading away and do it only once at initialization time
Date: Wed, 30 Nov 2005 00:58:31 +0100	[thread overview]
Message-ID: <11333087112659-git-send-email-malattia@linux.it> (raw)
In-Reply-To: <11333087113994-git-send-email-malattia@linux.it>

Signed-off-by: Mattia Dongili <malattia@linux.it>

---

 arch/i386/kernel/cpu/cpufreq/speedstep-ich.c |   45 ++++++++++++++++++--------
 1 files changed, 32 insertions(+), 13 deletions(-)

applies-to: 41c86716d1584bad6ddf55c9132ef8b820bc1b15
31c370b9ba20188340635fd7cebc150c4b71b097
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
index 5b7d18a..17b7864 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
@@ -40,6 +40,7 @@ static struct pci_dev *speedstep_chipset
  */
 static unsigned int speedstep_processor = 0;
 
+static u32 pmbase;
 
 /*
  *   There are only two frequency states for each processor. Values
@@ -56,34 +57,48 @@ static struct cpufreq_frequency_table sp
 
 
 /**
- * speedstep_set_state - set the SpeedStep state
- * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
+ * speedstep_find_register - read the PMBASE address
  *
- *   Tries to change the SpeedStep state.
+ * Returns: -ENODEV if no register could be found
  */
-static void speedstep_set_state (unsigned int state)
+static int speedstep_find_register (void)
 {
-	u32 pmbase;
-	u8 pm2_blk;
-	u8 value;
-	unsigned long flags;
-
-	if (!speedstep_chipset_dev || (state > 0x1))
-		return;
+	
+	if (!speedstep_chipset_dev)
+		return -ENODEV;
 
 	/* get PMBASE */
 	pci_read_config_dword(speedstep_chipset_dev, 0x40, &pmbase);
 	if (!(pmbase & 0x01)) {
 		printk(KERN_ERR "speedstep-ich: could not find speedstep register\n");
-		return;
+		return -ENODEV;
 	}
 
 	pmbase &= 0xFFFFFFFE;
 	if (!pmbase) {
 		printk(KERN_ERR "speedstep-ich: could not find speedstep register\n");
-		return;
+		return -ENODEV;
 	}
 
+	dprintk("pmbase is 0x%x\n", pmbase);
+	return 0;
+}
+
+/**
+ * speedstep_set_state - set the SpeedStep state
+ * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
+ *
+ *   Tries to change the SpeedStep state.
+ */
+static void speedstep_set_state (unsigned int state)
+{
+	u8 pm2_blk;
+	u8 value;
+	unsigned long flags;
+
+	if (state > 0x1)
+		return;
+
 	/* Disable IRQs */
 	local_irq_save(flags);
 
@@ -400,6 +415,10 @@ static int __init speedstep_init(void)
 		return -EINVAL;
 	}
 
+	if (speedstep_find_register()) {
+		return -ENODEV;
+	}
+
 	return cpufreq_register_driver(&speedstep_driver);
 }
 
---
0.99.9.GIT

  reply	other threads:[~2005-11-29 23:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-29 23:58 [RFC][PATCH 0/0] measure speedstep-ich transition latency at CPU initialization Mattia Dongili
2005-11-29 23:58 ` Mattia Dongili [this message]
2005-11-29 23:58   ` [PATCH 2/2] Measure transition latency at driver initialization Mattia Dongili
2005-11-30 11:46     ` Eric Piel
2005-11-30 22:30       ` Mattia Dongili
2005-11-30 23:41         ` Eric Piel
2005-12-01 19:31           ` [PATCH 2/2 updated] " Mattia Dongili
2005-12-01 21:05             ` Eric Piel
2005-12-01 23:34               ` Mattia Dongili
2005-12-02 11:37                 ` Eric Piel
2005-12-02 13:34                   ` Mattia Dongili
2005-12-02 20:59                     ` Mattia Dongili
2005-12-02 23:43                       ` Eric Piel
2005-12-04 17:00                       ` Dominik Brodowski
2005-12-02  4:38               ` Ville Syrjälä
2005-11-30 11:02   ` [PATCH 1/2] Move PMBASE reading away and do it only once at initialization time Eric Piel
2005-11-30 21:00     ` Mattia Dongili
2005-12-04 16:58       ` Dominik Brodowski

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=11333087112659-git-send-email-malattia@linux.it \
    --to=malattia@linux.it \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=linux@dominikbrodowski.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.