All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][powernow-k7] correcting SGTC.  Timer is based upon FSB.
@ 2004-04-14 10:36 Bruno Ducrot
  2004-04-14 10:41 ` Dave Jones
  0 siblings, 1 reply; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-14 10:36 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

Hi Dave,

I think this patch is needed especially if the FSB is around 166MHz or
200MHz, or else I believe we get instabilities on some K7's motherboard
powernow capable (it's called Cool'n Quiet IIRC).


* Deduce fsb from cpu_khz and the max multiplier.  It will be given as kHz now,
  so that frequency associated to a multiplier will be computate more
  accurately.  Also, we need it for SGTC (see below).
* Fix how cpuid is computed in powernow_decode_bios().
* Be more restrictive for PST.  It may be possible (on desktop shipped with
  low power Athlon models) that FSB can be changed by dip switchs on
  motherboard for example.
* Fix computation for SGTC.  It use the bus timer (and then the bus
  frequency given by fsb).

 arch/i386/kernel/cpu/cpufreq/powernow-k7.c |  152 ++++++++++++++++++++++-------
 1 files changed, 119 insertions(+), 33 deletions(-)

--- linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 09:25:59	1.1
+++ linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 10:18:59
@@ -85,6 +85,14 @@
 static unsigned int latency;
 static char have_a0;
 
+static int check_fsb(unsigned int fsbspeed)
+{
+	int delta;
+	unsigned int f = fsb / 1000;
+
+	delta = (fsbspeed > f) ? fsbspeed - f : f - fsbspeed;
+	return (delta < 5);
+}
 
 static int check_powernow(void)
 {
@@ -140,7 +148,8 @@
 
 static int get_ranges (unsigned char *pst)
 {
-	unsigned int j, speed;
+	unsigned int j;
+	unsigned int speed;
 	u8 fid, vid;
 
 	powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
@@ -151,12 +160,12 @@
 	for (j=0 ; j < number_scales; j++) {
 		fid = *pst++;
 
-		powernow_table[j].frequency = fsb * fid_codes[fid] * 100;
+		powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10;
 		powernow_table[j].index = fid; /* lower 8 bits */
 
-		speed = fsb * (fid_codes[fid]/10);
+		speed = powernow_table[j].frequency;
+
 		if ((fid_codes[fid] % 10)==5) {
-			speed += fsb/2;
 #if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 			if (have_a0 == 1)
 				powernow_table[j].frequency = CPUFREQ_ENTRY_INVALID;
@@ -164,7 +173,7 @@
 		}
 
 		dprintk (KERN_INFO PFX "   FID: 0x%x (%d.%dx [%dMHz])\t", fid,
-			fid_codes[fid] / 10, fid_codes[fid] % 10, speed);
+			fid_codes[fid] / 10, fid_codes[fid] % 10, speed/1000);
 
 		if (speed < minimum_speed)
 			minimum_speed = speed;
@@ -234,7 +243,8 @@
 
 	rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
 	cfid = fidvidstatus.bits.CFID;
-	freqs.old = fsb * fid_codes[cfid] * 100;
+	freqs.old = fsb * fid_codes[cfid] / 10;
+
 	freqs.new = powernow_table[index].frequency;
 
 	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
@@ -266,15 +276,12 @@
 {
 	struct psb_s *psb;
 	struct pst_s *pst;
-	struct cpuinfo_x86 *c = cpu_data;
 	unsigned int i, j;
 	unsigned char *p;
 	unsigned int etuple;
 	unsigned int ret;
 
 	etuple = cpuid_eax(0x80000001);
-	etuple &= 0xf00;
-	etuple |= (c->x86_model<<4)|(c->x86_mask);
 
 	for (i=0xC0000; i < 0xffff0 ; i+=16) {
 
@@ -305,7 +312,6 @@
 			}
 			dprintk (KERN_INFO PFX "Settling Time: %d microseconds.\n", psb->settlingtime);
 			dprintk (KERN_INFO PFX "Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst);
-			latency *= 100;	/* SGTC needs to be in units of 10ns */
 
 			p += sizeof (struct psb_s);
 
@@ -315,7 +321,8 @@
 				pst = (struct pst_s *) p;
 				number_scales = pst->numpstates;
 
-				if ((etuple == pst->cpuid) && (maxfid==pst->maxfid) && (startvid==pst->startvid))
+				if ((etuple == pst->cpuid) && check_fsb(pst->fsbspeed) &&
+				    (maxfid==pst->maxfid) && (startvid==pst->startvid))
 				{
 					dprintk (KERN_INFO PFX "PST:%d (@%p)\n", i, pst);
 					dprintk (KERN_INFO PFX " cpuid: 0x%x\t", pst->cpuid);
@@ -323,7 +330,6 @@
 					dprintk ("maxFID: 0x%x\t", pst->maxfid);
 					dprintk ("startvid: 0x%x\n", pst->startvid);
 
-					fsb = pst->fsbspeed;
 					ret = get_ranges ((char *) pst + sizeof (struct pst_s));
 					return ret;
 
@@ -365,6 +371,33 @@
 	return cpufreq_frequency_table_verify(policy, powernow_table);
 }
 
+/*
+ * We use the fact that the bus frequency is somehow
+ * a multiple of 100000/3 khz, then we compute sgtc according
+ * to this multiple.
+ * That way, we match more how AMD thinks all of that work.
+ * We will then get the same kind of behaviour already tested under
+ * the "well-known" other OS.
+ */
+static int __init fixup_sgtc(void)
+{
+	unsigned int sgtc;
+	unsigned int m;
+
+	m = fsb / 3333;
+	if ((m % 10) >= 5)
+		m += 5;
+
+	m /= 10;
+
+	sgtc = 100 * m * latency;
+	sgtc = sgtc / 3;
+	if (sgtc > 0xfffff) {
+		printk(KERN_WARNING PFX "SGTC too large %d\n", sgtc);
+		sgtc = 0xfffff;
+	}
+	return sgtc;
+}
 
 static int __init powernow_cpu_init (struct cpufreq_policy *policy)
 {
@@ -376,18 +409,28 @@
 
 	rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
 
+	/* A K7 with powernow technology is set to max frequency by BIOS */
+	fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.MFID];
+	if (!fsb) {
+		printk(KERN_WARNING PFX "can not determine bus frequency\n");
+		return -EINVAL;
+	}
+	dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
+
 	result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID);
 	if (result)
 		return result;
 
 	printk (KERN_INFO PFX "Minimum speed %d MHz. Maximum speed %d MHz.\n",
-				minimum_speed, maximum_speed);
+				minimum_speed/1000, maximum_speed/1000);
 
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 
-	/* latency is in 10 ns (look for SGTC above) for each VID
-	 * and FID transition, so multiply that value with 20 */
-	policy->cpuinfo.transition_latency = latency * 20;
+	policy->cpuinfo.transition_latency = latency * 2;
+
+	/* SGTC use the bus clock as timer */
+	latency = fixup_sgtc();
+	printk(KERN_INFO PFX "SGTC: %d\n", latency);
 
 	policy->cur = maximum_speed;
 


Cheers,

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 10:36 [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB Bruno Ducrot
@ 2004-04-14 10:41 ` Dave Jones
  2004-04-14 12:18   ` Bruno Ducrot
  0 siblings, 1 reply; 14+ messages in thread
From: Dave Jones @ 2004-04-14 10:41 UTC (permalink / raw)
  To: Bruno Ducrot; +Cc: cpufreq

On Wed, Apr 14, 2004 at 12:36:46PM +0200, Bruno Ducrot wrote:
 > Hi Dave,
 > 
 > I think this patch is needed especially if the FSB is around 166MHz or
 > 200MHz, or else I believe we get instabilities on some K7's motherboard
 > powernow capable (it's called Cool'n Quiet IIRC).

Looks good, applied.  It'll turn up in the next -mm.

thanks,

		Dave

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 10:41 ` Dave Jones
@ 2004-04-14 12:18   ` Bruno Ducrot
  2004-04-14 12:23     ` Dave Jones
                       ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-14 12:18 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

On Wed, Apr 14, 2004 at 11:41:48AM +0100, Dave Jones wrote:
> On Wed, Apr 14, 2004 at 12:36:46PM +0200, Bruno Ducrot wrote:
>  > Hi Dave,
>  > 
>  > I think this patch is needed especially if the FSB is around 166MHz or
>  > 200MHz, or else I believe we get instabilities on some K7's motherboard
>  > powernow capable (it's called Cool'n Quiet IIRC).
> 
> Looks good, applied.  It'll turn up in the next -mm.
> 

Already?  Thanks!
I actually wanted to submit also the ACPI integration...

Warning: it will only half work on the ACER Aspire, though: there is
no pstate in the DSDT corresponding to the max frequency...
I'm looking how to handle that correctly, probably at the init stage,
if the max frequency is not given, then add it to powernow_table.  It's
really ugly, but I don't know how to make that OK.
Suggestion is of course welcome..


* Integrate acpi perflib from Dominik.
* Use acpi if the PST tables are known to be broken (ASUS Aspire match one PST,
  but give brain damaged values), or use ACPI if no PST found.

 arch/i386/kernel/cpu/cpufreq/powernow-k7.c |  180 +++++++++++++++++++++++++++--
 1 files changed, 168 insertions(+), 12 deletions(-)

--- linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 11:49:44	1.3
+++ linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 12:11:24
@@ -27,6 +27,11 @@
 #include <asm/io.h>
 #include <asm/system.h>
 
+#ifdef CONFIG_ACPI_PROCESSOR
+#include <linux/acpi.h>
+#include <acpi/processor.h>
+#endif
+
 #include "powernow-k7.h"
 
 #define DEBUG
@@ -57,6 +62,17 @@ struct pst_s {
 	u8 numpstates;
 };
 
+#ifdef CONFIG_ACPI_PROCESSOR
+union powernow_acpi_control_t {
+	struct {
+		unsigned long fid:5,
+		vid:5,
+		sgtc:20,
+		res1:2;
+	} bits;
+	unsigned long val;
+};
+#endif
 
 /* divide by 1000 to get VID. */
 static int mobile_vid_table[32] = {
@@ -272,6 +288,129 @@ static void change_speed (unsigned int i
 }
 
 
+#ifdef CONFIG_ACPI_PROCESSOR
+
+struct acpi_processor_performance *acpi_processor_perf;
+
+static int powernow_acpi_init(void)
+{
+	int i;
+	int retval = 0;
+	union powernow_acpi_control_t pc;
+
+	if (acpi_processor_perf != NULL && powernow_table != NULL) {
+		retval = -EINVAL;
+		goto err0;
+	}
+
+	acpi_processor_perf = kmalloc(sizeof(struct acpi_processor_performance),
+				      GFP_KERNEL);
+
+	if (!acpi_processor_perf) {
+		retval = -ENOMEM;
+		goto err0;
+	}
+
+	memset(acpi_processor_perf, 0, sizeof(struct acpi_processor_performance));
+
+	if (acpi_processor_register_performance(acpi_processor_perf, 0)) {
+		retval = -EIO;
+		goto err1;
+	}
+
+	if (acpi_processor_perf->control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) {
+		retval = -ENODEV;
+		goto err2;
+	}
+
+	if (acpi_processor_perf->status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) {
+		retval = -ENODEV;
+		goto err2;
+	}
+
+	number_scales = acpi_processor_perf->state_count;
+
+	if (number_scales < 2) {
+		retval = -ENODEV;
+		goto err2;
+	}
+
+	powernow_table = kmalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL);
+	if (!powernow_table) {
+		retval = -ENOMEM;
+		goto err2;
+	}
+
+	memset(powernow_table, 0, ((number_scales + 1) * sizeof(struct cpufreq_frequency_table)));
+
+	pc.val = (unsigned long) acpi_processor_perf->states[0].control;
+	for (i = 0; i < number_scales; i++) {
+		u8 fid, vid;
+		unsigned int speed;
+
+		pc.val = (unsigned long) acpi_processor_perf->states[i].control;
+		dprintk (KERN_INFO PFX "acpi:  P%d: %d MHz, %d mW, %d uS, control %08x, status %08x, vid: %02x fid: %02x SGTC: %d\n",
+			 i,
+			 (u32) acpi_processor_perf->states[i].core_frequency,
+			 (u32) acpi_processor_perf->states[i].power,
+			 (u32) acpi_processor_perf->states[i].transition_latency,
+			 (u32) acpi_processor_perf->states[i].control,
+			 (u32) acpi_processor_perf->states[i].status,
+			 pc.bits.vid,
+			 pc.bits.fid,
+			 pc.bits.sgtc);
+
+		vid = pc.bits.vid;
+		fid = pc.bits.fid;
+
+		powernow_table[i].frequency = (fsb * fid_codes[fid]);
+		powernow_table[i].index = fid; /* lower 8 bits */
+		powernow_table[i].index |= (vid << 8); /* upper 8 bits */
+
+		speed = powernow_table[i].frequency;
+
+		if ((fid_codes[fid] % 10)==5) {
+			if (have_a0 == 1)
+				powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+		}
+
+		dprintk (KERN_INFO PFX "   FID: 0x%x (%d.%dx [%dMHz])\t", fid,
+			fid_codes[fid] / 10, fid_codes[fid] % 10, speed/1000);
+		dprintk ("VID: 0x%x (%d.%03dV)\n", vid,	mobile_vid_table[vid]/1000,
+			mobile_vid_table[vid]%1000);
+
+		if (latency < pc.bits.sgtc)
+			latency = pc.bits.sgtc;
+
+		if (speed < minimum_speed)
+			minimum_speed = speed;
+		if (speed > maximum_speed)
+			maximum_speed = speed;
+	}
+
+	powernow_table[i].frequency = CPUFREQ_TABLE_END;
+	powernow_table[i].index = 0;
+
+	return 0;
+
+err2:
+	acpi_processor_unregister_performance(acpi_processor_perf, 0);
+err1:
+	kfree(acpi_processor_perf);
+err0:
+	printk(KERN_WARNING PFX "ACPI perflib can not be used in this platform\n");
+	acpi_processor_perf = NULL;
+	return retval;
+}
+#else
+static int powernow_acpi_init(void)
+{
+	printk(KERN_INFO PFX "no support for ACPI processor found."
+	       "  Please recompile your kernel with ACPI processor\n");
+	return -EINVAL;
+}
+#endif
+
 static int powernow_decode_bios (int maxfid, int startvid)
 {
 	struct psb_s *psb;
@@ -341,8 +480,14 @@ static int powernow_decode_bios (int max
 			}
 			printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
 			printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
-			printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
-			return -EINVAL;
+
+			printk (KERN_INFO PFX "Trying ACPI perflib\n");
+			ret = powernow_acpi_init();
+			if (ret) {
+				printk (KERN_INFO PFX "ACPI and legacy methods failed\n");
+				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
+			}
+			return ret;
 		}
 		p++;
 	}
@@ -417,7 +562,20 @@ static int __init powernow_cpu_init (str
 	}
 	dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
 
-	result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID);
+	if (dmi_broken & BROKEN_CPUFREQ) {
+		printk (KERN_INFO PFX "PSB/PST known to be broken.  Trying ACPI instead\n");
+		result = powernow_acpi_init();
+	} else {
+		result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID);
+		if (result) {
+			result = powernow_acpi_init();
+		} else {
+			/* SGTC use the bus clock as timer */
+			latency = fixup_sgtc();
+			printk(KERN_INFO PFX "SGTC: %d\n", latency);
+		}
+	}
+
 	if (result)
 		return result;
 
@@ -426,11 +584,7 @@ static int __init powernow_cpu_init (str
 
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 
-	policy->cpuinfo.transition_latency = latency * 2;
-
-	/* SGTC use the bus clock as timer */
-	latency = fixup_sgtc();
-	printk(KERN_INFO PFX "SGTC: %d\n", latency);
+	policy->cpuinfo.transition_latency = 20 * latency / fsb;
 
 	policy->cur = maximum_speed;
 
@@ -461,10 +615,6 @@ static struct cpufreq_driver powernow_dr
 
 static int __init powernow_init (void)
 {
-	if (dmi_broken & BROKEN_CPUFREQ) {
-		printk (KERN_INFO PFX "Disabled at boot time by DMI,\n");
-		return -ENODEV;
-	}
 	if (check_powernow()==0)
 		return -ENODEV;
 	return cpufreq_register_driver(&powernow_driver);
@@ -473,6 +623,12 @@ static int __init powernow_init (void)
 
 static void __exit powernow_exit (void)
 {
+#ifdef CONFIG_ACPI_PROCESSOR
+	if (acpi_processor_perf) {
+		acpi_processor_unregister_performance(acpi_processor_perf, 0);
+		kfree(acpi_processor_perf);
+	}
+#endif
 	cpufreq_unregister_driver(&powernow_driver);
 	if (powernow_table)
 		kfree(powernow_table);



-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 12:18   ` Bruno Ducrot
@ 2004-04-14 12:23     ` Dave Jones
  2004-04-14 12:47       ` Bruno Ducrot
  2004-04-14 13:28     ` Bruno Ducrot
  2004-04-14 17:44     ` Dave Jones
  2 siblings, 1 reply; 14+ messages in thread
From: Dave Jones @ 2004-04-14 12:23 UTC (permalink / raw)
  To: Bruno Ducrot; +Cc: cpufreq

On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
 > Already?  Thanks!
 > I actually wanted to submit also the ACPI integration...

Ok, I'll look at folding that in too after lunch.
 
 > Warning: it will only half work on the ACER Aspire, though: there is
 > no pstate in the DSDT corresponding to the max frequency...
 > I'm looking how to handle that correctly, probably at the init stage,
 > if the max frequency is not given, then add it to powernow_table.  It's
 > really ugly, but I don't know how to make that OK.
 > Suggestion is of course welcome..

Blacklist its BIOS with DMI tables, and adjust accordingly?
Is it fixed maybe in a BIOS update ?

 > * Integrate acpi perflib from Dominik.
 > * Use acpi if the PST tables are known to be broken (ASUS Aspire match one PST,
 >   but give brain damaged values), or use ACPI if no PST found.

Was that the one that had every entry exactly the same ?

		Dave

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 12:23     ` Dave Jones
@ 2004-04-14 12:47       ` Bruno Ducrot
  0 siblings, 0 replies; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-14 12:47 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

On Wed, Apr 14, 2004 at 01:23:22PM +0100, Dave Jones wrote:
> On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
>  > Already?  Thanks!
>  > I actually wanted to submit also the ACPI integration...
> 
> Ok, I'll look at folding that in too after lunch.
>  
>  > Warning: it will only half work on the ACER Aspire, though: there is
>  > no pstate in the DSDT corresponding to the max frequency...
>  > I'm looking how to handle that correctly, probably at the init stage,
>  > if the max frequency is not given, then add it to powernow_table.  It's
>  > really ugly, but I don't know how to make that OK.
>  > Suggestion is of course welcome..
> 
> Blacklist its BIOS with DMI tables, and adjust accordingly?

Yep.  Patch below (or I can send you the dmi output privately if you
prefer).

The machine is an ACER Aspire, look at:
http://bugzilla.kernel.org/show_bug.cgi?id=2025

> Is it fixed maybe in a BIOS update ?

I don't think so.  Advice already done, don't know if the owner have
done that though.

> 
>  > * Integrate acpi perflib from Dominik.
>  > * Use acpi if the PST tables are known to be broken (ASUS Aspire match one PST,
>  >   but give brain damaged values), or use ACPI if no PST found.
> 
> Was that the one that had every entry exactly the same ?

It give:
powernow:  cpuid: 0x781 fsb: 133        maxFID: 0x1     startvid: 0xb
powernow:    FID: 0x4 (5.0x [665MHz])   VID: 0xc (1.400V)
powernow:    FID: 0x6 (6.0x [798MHz])   VID: 0xc (1.400V)
powernow:    FID: 0x8 (7.0x [931MHz])   VID: 0xc (1.400V)
powernow:    FID: 0x9 (7.5x [997MHz])   VID: 0xc (1.400V)
powernow:    FID: 0x9 (7.5x [997MHz])   VID: 0xc (1.400V)

Whereas actually it's a mobile (startvid is 0xb.  So, voltage can be
scaled).
And there is 'only' two entries with same values.

With ACPI, (not tested yet) it should give that:

FID: 0xd (9.5x [1263.500MHz]    VID: 0xc (1.400mV)
FID: 0xa (8.0x [1064.000MHz]    VID: 0xd (1.350mV)
FID: 0x8 (7.0x [931.000MHz]    VID: 0xe (1.300mV)
FID: 0x6 (6.0x [798.000MHz]    VID: 0x11 (1.250mV)
FID: 0x4 (5.0x [665.000MHz]    VID: 0x13 (1.200mV)

It's better, but max still not here.

--- linux-dj-cpufreq/arch/i386/kernel/dmi_scan.c	2004/04/14 12:28:28	1.1
+++ linux-dj-cpufreq/arch/i386/kernel/dmi_scan.c	2004/04/14 12:29:42
@@ -921,6 +921,12 @@ static __initdata struct dmi_blacklist d
 			NO_MATCH, NO_MATCH,
 			} },
 
+	{ acer_cpufreq_pst, "Acer Aspire", {
+			MATCH(DMI_SYS_VENDOR, "Insyde Software"),
+			MATCH(DMI_BIOS_VERSION, "3A23"),
+			NO_MATCH, NO_MATCH,
+			} },
+
 #ifdef	CONFIG_ACPI_BOOT
 	/*
 	 * If your system is blacklisted here, but you find that acpi=force



-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 12:18   ` Bruno Ducrot
  2004-04-14 12:23     ` Dave Jones
@ 2004-04-14 13:28     ` Bruno Ducrot
  2004-04-14 13:31       ` Dave Jones
  2004-04-14 17:44     ` Dave Jones
  2 siblings, 1 reply; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-14 13:28 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
> * Integrate acpi perflib from Dominik.
> * Use acpi if the PST tables are known to be broken (ASUS Aspire match one PST,
>   but give brain damaged values), or use ACPI if no PST found.
> 
>  arch/i386/kernel/cpu/cpufreq/powernow-k7.c |  180 +++++++++++++++++++++++++++--
>  1 files changed, 168 insertions(+), 12 deletions(-)
> 
> --- linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 11:49:44	1.3
> +++ linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 12:11:24
....

> @@ -341,8 +480,14 @@ static int powernow_decode_bios (int max
>  			}
>  			printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
>  			printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
> -			printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
> -			return -EINVAL;
> +
> +			printk (KERN_INFO PFX "Trying ACPI perflib\n");
> +			ret = powernow_acpi_init();
> +			if (ret) {
> +				printk (KERN_INFO PFX "ACPI and legacy methods failed\n");
> +				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
> +			}
> +			return ret;
>  		}
>  		p++;
>  	}


This chunk is wrong, because I handle that at powernow_cpu_init() now.
Just removing that one should be OK.  Do you want I resend the whole
patch, or only that part ?

Sorry.

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 13:28     ` Bruno Ducrot
@ 2004-04-14 13:31       ` Dave Jones
  2004-04-14 13:52         ` Bruno Ducrot
  0 siblings, 1 reply; 14+ messages in thread
From: Dave Jones @ 2004-04-14 13:31 UTC (permalink / raw)
  To: Bruno Ducrot; +Cc: cpufreq

On Wed, Apr 14, 2004 at 03:28:54PM +0200, Bruno Ducrot wrote:
 > On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
 > > * Integrate acpi perflib from Dominik.
 > > * Use acpi if the PST tables are known to be broken (ASUS Aspire match one PST,
 > >   but give brain damaged values), or use ACPI if no PST found.
 > > 
 > >  arch/i386/kernel/cpu/cpufreq/powernow-k7.c |  180 +++++++++++++++++++++++++++--
 > >  1 files changed, 168 insertions(+), 12 deletions(-)
 > > 
 > > --- linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 11:49:44	1.3
 > > +++ linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 12:11:24
 > ....
 > 
 > > @@ -341,8 +480,14 @@ static int powernow_decode_bios (int max
 > >  			}
 > >  			printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
 > >  			printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
 > > -			printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
 > > -			return -EINVAL;
 > > +
 > > +			printk (KERN_INFO PFX "Trying ACPI perflib\n");
 > > +			ret = powernow_acpi_init();
 > > +			if (ret) {
 > > +				printk (KERN_INFO PFX "ACPI and legacy methods failed\n");
 > > +				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
 > > +			}
 > > +			return ret;
 > >  		}
 > >  		p++;
 > >  	}
 > 
 > 
 > This chunk is wrong, because I handle that at powernow_cpu_init() now.
 > Just removing that one should be OK.  Do you want I resend the whole
 > patch, or only that part ?

oops. just send me a patch backing out that bit..

		Dave

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 13:31       ` Dave Jones
@ 2004-04-14 13:52         ` Bruno Ducrot
  0 siblings, 0 replies; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-14 13:52 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

On Wed, Apr 14, 2004 at 02:31:17PM +0100, Dave Jones wrote:
> 
> oops. just send me a patch backing out that bit..
> 

I'm very sorry.  I include the late_initcall btw.  I think it's needed
for ACPI perflib.

--- linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 12:32:12	1.4
+++ linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 13:54:31
@@ -481,13 +481,7 @@ static int powernow_decode_bios (int max
 			printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
 			printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
 
-			printk (KERN_INFO PFX "Trying ACPI perflib\n");
-			ret = powernow_acpi_init();
-			if (ret) {
-				printk (KERN_INFO PFX "ACPI and legacy methods failed\n");
-				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
-			}
-			return ret;
+			return -EINVAL;
 		}
 		p++;
 	}
@@ -568,7 +562,12 @@ static int __init powernow_cpu_init (str
 	} else {
 		result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID);
 		if (result) {
+			printk (KERN_INFO PFX "Trying ACPI perflib\n");
 			result = powernow_acpi_init();
+			if (result) {
+				printk (KERN_INFO PFX "ACPI and legacy methods failed\n");
+				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
+			}
 		} else {
 			/* SGTC use the bus clock as timer */
 			latency = fixup_sgtc();
@@ -638,6 +637,6 @@ MODULE_AUTHOR ("Dave Jones <davej@codemo
 MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors.");
 MODULE_LICENSE ("GPL");
 
-module_init(powernow_init);
+late_initcall(powernow_init);
 module_exit(powernow_exit);
 

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 12:18   ` Bruno Ducrot
  2004-04-14 12:23     ` Dave Jones
  2004-04-14 13:28     ` Bruno Ducrot
@ 2004-04-14 17:44     ` Dave Jones
  2004-04-14 18:48       ` Dominik Brodowski
                         ` (2 more replies)
  2 siblings, 3 replies; 14+ messages in thread
From: Dave Jones @ 2004-04-14 17:44 UTC (permalink / raw)
  To: Bruno Ducrot; +Cc: cpufreq

On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:

 > I actually wanted to submit also the ACPI integration...

I just tried this out on my Compaq Evo 1015.  It has working
PST, so just uses that.  I got curious though, and hardwired it
to fall back to the ACPI method. This is what it comes out with on
PST..

powernow: PowerNOW! Technology present. Can scale: frequency and voltage.
powernow: FSB: 132.525 MHz
powernow: Found PSB header at 020f0800
powernow: Table version: 0x12
powernow: Flags: 0x0 (Mobile voltage regulator)
powernow: Settling Time: 100 microseconds.
powernow: Has 31 PST tables. (Only dumping ones relevant to this CPU).
powernow: PST:26 (@020f09c2)
powernow:  cpuid: 0x780 fsb: 133        maxFID: 0xf     startvid: 0x9
powernow:    FID: 0x12 (4.0x [530MHz])  VID: 0x13 (1.200V)
powernow:    FID: 0x4 (5.0x [662MHz])   VID: 0x13 (1.200V)
powernow:    FID: 0x6 (6.0x [795MHz])   VID: 0x13 (1.200V)
powernow:    FID: 0xa (8.0x [1060MHz])  VID: 0xd (1.350V)
powernow:    FID: 0xf (10.5x [1391MHz]) VID: 0x9 (1.550V)
powernow: SGTC: 13333
powernow: Minimum speed 530 MHz. Maximum speed 1391 MHz.

And with the hardwired acpi fallback..

powernow: Trying ACPI perflib
powernow: acpi:  P0: 1400 MHz, 35000 mW, 125 uS, control 009c412f, status 0000012f, vid: 09 fid: 0f SGTC: 10000
powernow:    FID: 0xf (10.5x [13913MHz])        VID: 0x9 (1.550V)
powernow: acpi:  P1: 1100 MHz, 15487 mW, 125 uS, control 009c41aa, status 000001aa, vid: 0d fid: 0a SGTC: 10000
powernow:    FID: 0xa (8.0x [10600MHz]) VID: 0xd (1.350V)
powernow: acpi:  P2: 800 MHz, 12310 mW, 125 uS, control 009c4266, status 00000266, vid: 13 fid: 06 SGTC: 10000
powernow:    FID: 0x6 (6.0x [7950MHz])  VID: 0x13 (1.200V)
powernow: acpi:  P3: 660 MHz, 12310 mW, 125 uS, control 009c4264, status 00000264, vid: 13 fid: 04 SGTC: 10000
powernow:    FID: 0x4 (5.0x [6625MHz])  VID: 0x13 (1.200V)
powernow: acpi:  P4: 530 MHz, 10258 mW, 125 uS, control 009c4272, status 00000272, vid: 13 fid: 12 SGTC: 10000
powernow:    FID: 0x12 (4.0x [5300MHz]) VID: 0x13 (1.200V)
powernow: Minimum speed 530 MHz. Maximum speed 13913 MHz.

Maximum speed seems off by a factor of 10.
Formatting of that debug info could also probably be cleaned up a little,
as its very wide.  How do you feel about adding a module_param to force
fallback, so we can get a few more people testing it too ?

		Dave

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 17:44     ` Dave Jones
@ 2004-04-14 18:48       ` Dominik Brodowski
  2004-04-14 18:58       ` Bruno Ducrot
  2004-04-14 19:02       ` Dominik Brodowski
  2 siblings, 0 replies; 14+ messages in thread
From: Dominik Brodowski @ 2004-04-14 18:48 UTC (permalink / raw)
  To: Dave Jones; +Cc: Bruno Ducrot, cpufreq


[-- Attachment #1.1: Type: text/plain, Size: 779 bytes --]

On Wed, Apr 14, 2004 at 06:44:07PM +0100, Dave Jones wrote:
> On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
> 
>  > I actually wanted to submit also the ACPI integration...
> 
> I just tried this out on my Compaq Evo 1015.  It has working
> PST, so just uses that.  I got curious though, and hardwired it
> to fall back to the ACPI method. This is what it comes out with on
> PST..

Will take a look at cpufreq-2004-04-14 in a moment.

> Maximum speed seems off by a factor of 10.
> Formatting of that debug info could also probably be cleaned up a little,
> as its very wide.  How do you feel about adding a module_param to force
> fallback, so we can get a few more people testing it too ?

I consider this to be a _very_ good idea.

	Dominik

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 17:44     ` Dave Jones
  2004-04-14 18:48       ` Dominik Brodowski
@ 2004-04-14 18:58       ` Bruno Ducrot
  2004-04-14 19:19         ` Dominik Brodowski
  2004-04-14 19:02       ` Dominik Brodowski
  2 siblings, 1 reply; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-14 18:58 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

On Wed, Apr 14, 2004 at 06:44:07PM +0100, Dave Jones wrote:
> On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
> 
>  > I actually wanted to submit also the ACPI integration...
> 
> I just tried this out on my Compaq Evo 1015.  It has working
> PST, so just uses that.  I got curious though, and hardwired it
> to fall back to the ACPI method. This is what it comes out with on
> PST..
> 
> powernow: PowerNOW! Technology present. Can scale: frequency and voltage.
> powernow: FSB: 132.525 MHz
> powernow: Found PSB header at 020f0800
> powernow: Table version: 0x12
> powernow: Flags: 0x0 (Mobile voltage regulator)
> powernow: Settling Time: 100 microseconds.
> powernow: Has 31 PST tables. (Only dumping ones relevant to this CPU).
> powernow: PST:26 (@020f09c2)
> powernow:  cpuid: 0x780 fsb: 133        maxFID: 0xf     startvid: 0x9
> powernow:    FID: 0x12 (4.0x [530MHz])  VID: 0x13 (1.200V)
> powernow:    FID: 0x4 (5.0x [662MHz])   VID: 0x13 (1.200V)
> powernow:    FID: 0x6 (6.0x [795MHz])   VID: 0x13 (1.200V)
> powernow:    FID: 0xa (8.0x [1060MHz])  VID: 0xd (1.350V)
> powernow:    FID: 0xf (10.5x [1391MHz]) VID: 0x9 (1.550V)
> powernow: SGTC: 13333
> powernow: Minimum speed 530 MHz. Maximum speed 1391 MHz.
> 
> And with the hardwired acpi fallback..
> 
> powernow: Trying ACPI perflib
> powernow: acpi:  P0: 1400 MHz, 35000 mW, 125 uS, control 009c412f, status 0000012f, vid: 09 fid: 0f SGTC: 10000
> powernow:    FID: 0xf (10.5x [13913MHz])        VID: 0x9 (1.550V)
> powernow: acpi:  P1: 1100 MHz, 15487 mW, 125 uS, control 009c41aa, status 000001aa, vid: 0d fid: 0a SGTC: 10000
> powernow:    FID: 0xa (8.0x [10600MHz]) VID: 0xd (1.350V)
> powernow: acpi:  P2: 800 MHz, 12310 mW, 125 uS, control 009c4266, status 00000266, vid: 13 fid: 06 SGTC: 10000
> powernow:    FID: 0x6 (6.0x [7950MHz])  VID: 0x13 (1.200V)
> powernow: acpi:  P3: 660 MHz, 12310 mW, 125 uS, control 009c4264, status 00000264, vid: 13 fid: 04 SGTC: 10000
> powernow:    FID: 0x4 (5.0x [6625MHz])  VID: 0x13 (1.200V)
> powernow: acpi:  P4: 530 MHz, 10258 mW, 125 uS, control 009c4272, status 00000272, vid: 13 fid: 12 SGTC: 10000
> powernow:    FID: 0x12 (4.0x [5300MHz]) VID: 0x13 (1.200V)
> powernow: Minimum speed 530 MHz. Maximum speed 13913 MHz.
> 
> Maximum speed seems off by a factor of 10.

Oh my...  I've tested that and for some strange reason, I have noticed
nothing..

> Formatting of that debug info could also probably be cleaned up a little,
> as its very wide.

Ok, I will remove some debug info.  Status is not needed, it's more to
make ACPI spec happy actually.  I need SGTC. I keep it.  It's stupid
to get fid and vid on the acpi line: I's redundant with the second debug
line.

That give that for me now:

powernow: PowerNOW! Technology present. Can scale: frequency and
voltage.
powernow: FSB: 132.720 MHz
powernow: PSB/PST known to be broken.  Trying ACPI instead
powernow: acpi:  P0: 1800 MHz 45000 mW 125 uS control 00d05975 SGTC
13334
powernow:    FID: 0x15 (13.5x [1791MHz])        VID: 0xb (1.450V)
powernow: acpi:  P1: 1200 MHz 22295 mW 125 uS control 00d05a2c SGTC
13334
powernow:    FID: 0xc (9.0x [1194MHz])  VID: 0x11 (1.250V)
powernow: acpi:  P2: 933 MHz 14671 mW 125 uS control 00d05aa8 SGTC 13334
powernow:    FID: 0x8 (7.0x [929MHz])   VID: 0x15 (1.150V)
powernow: acpi:  P3: 800 MHz 10487 mW 125 uS control 00d05b26 SGTC 13334
powernow:    FID: 0x6 (6.0x [796MHz])   VID: 0x19 (1.050V)
powernow: acpi:  P4: 667 MHz 8744 mW 125 uS control 00d05b24 SGTC 13334
powernow:    FID: 0x4 (5.0x [663MHz])   VID: 0x19 (1.050V)
powernow: Minimum speed 663 MHz. Maximum speed 1791 MHz.


> How do you feel about adding a module_param to force
> fallback, so we can get a few more people testing it too ?

Agreed.  Though I don't understand if you want ACPI enabled by default, or
legacy?


--- linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 18:10:27	1.5
+++ linux-dj-cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/04/14 18:49:02
@@ -17,6 +17,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h> 
+#include <linux/moduleparam.h> 
 #include <linux/init.h>
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
@@ -90,6 +91,12 @@ static int fid_codes[32] = {
     150, 225, 160, 165, 170, 180, -1, -1,
 };
 
+/* This parameter is used in order to force ACPI instead of legacy method for
+ * configuration purpose.
+ */
+
+static int powernow_acpi_force;
+
 static struct cpufreq_frequency_table *powernow_table;
 
 static unsigned int can_scale_bus;
@@ -349,21 +356,18 @@ static int powernow_acpi_init(void)
 		unsigned int speed;
 
 		pc.val = (unsigned long) acpi_processor_perf->states[i].control;
-		dprintk (KERN_INFO PFX "acpi:  P%d: %d MHz, %d mW, %d uS, control %08x, status %08x, vid: %02x fid: %02x SGTC: %d\n",
+		dprintk (KERN_INFO PFX "acpi:  P%d: %d MHz %d mW %d uS control %08x SGTC %d\n",
 			 i,
 			 (u32) acpi_processor_perf->states[i].core_frequency,
 			 (u32) acpi_processor_perf->states[i].power,
 			 (u32) acpi_processor_perf->states[i].transition_latency,
 			 (u32) acpi_processor_perf->states[i].control,
-			 (u32) acpi_processor_perf->states[i].status,
-			 pc.bits.vid,
-			 pc.bits.fid,
 			 pc.bits.sgtc);
 
 		vid = pc.bits.vid;
 		fid = pc.bits.fid;
 
-		powernow_table[i].frequency = (fsb * fid_codes[fid]);
+		powernow_table[i].frequency = fsb * fid_codes[fid] / 10;
 		powernow_table[i].index = fid; /* lower 8 bits */
 		powernow_table[i].index |= (vid << 8); /* upper 8 bits */
 
@@ -556,7 +560,7 @@ static int __init powernow_cpu_init (str
 	}
 	dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
 
-	if (dmi_broken & BROKEN_CPUFREQ) {
+	if ((dmi_broken & BROKEN_CPUFREQ) || powernow_acpi_force) {
 		printk (KERN_INFO PFX "PSB/PST known to be broken.  Trying ACPI instead\n");
 		result = powernow_acpi_init();
 	} else {
@@ -633,6 +637,10 @@ static void __exit powernow_exit (void)
 		kfree(powernow_table);
 }
 
+module_param(powernow_acpi_force,  int, 0444);
+
+MODULE_PARM_DESC(powernow_acpi_force, "Force ACPI to be used");
+
 MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
 MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors.");
 MODULE_LICENSE ("GPL");


-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 17:44     ` Dave Jones
  2004-04-14 18:48       ` Dominik Brodowski
  2004-04-14 18:58       ` Bruno Ducrot
@ 2004-04-14 19:02       ` Dominik Brodowski
  2 siblings, 0 replies; 14+ messages in thread
From: Dominik Brodowski @ 2004-04-14 19:02 UTC (permalink / raw)
  To: Dave Jones; +Cc: Bruno Ducrot, cpufreq

On Wed, Apr 14, 2004 at 06:44:07PM +0100, Dave Jones wrote:
> On Wed, Apr 14, 2004 at 02:18:57PM +0200, Bruno Ducrot wrote:
> 
>  > I actually wanted to submit also the ACPI integration...
> 
> I just tried this out on my Compaq Evo 1015.  It has working
> PST, so just uses that.  I got curious though, and hardwired it
> to fall back to the ACPI method. This is what it comes out with on
> PST..
> 
> powernow: PowerNOW! Technology present. Can scale: frequency and voltage.
> powernow: FSB: 132.525 MHz
> powernow: Found PSB header at 020f0800
> powernow: Table version: 0x12
> powernow: Flags: 0x0 (Mobile voltage regulator)
> powernow: Settling Time: 100 microseconds.
> powernow: Has 31 PST tables. (Only dumping ones relevant to this CPU).
> powernow: PST:26 (@020f09c2)
> powernow:  cpuid: 0x780 fsb: 133        maxFID: 0xf     startvid: 0x9
> powernow:    FID: 0x12 (4.0x [530MHz])  VID: 0x13 (1.200V)
> powernow:    FID: 0x4 (5.0x [662MHz])   VID: 0x13 (1.200V)
> powernow:    FID: 0x6 (6.0x [795MHz])   VID: 0x13 (1.200V)
> powernow:    FID: 0xa (8.0x [1060MHz])  VID: 0xd (1.350V)
> powernow:    FID: 0xf (10.5x [1391MHz]) VID: 0x9 (1.550V)
> powernow: SGTC: 13333
> powernow: Minimum speed 530 MHz. Maximum speed 1391 MHz.
> 
> And with the hardwired acpi fallback..
> 
> powernow: Trying ACPI perflib
> powernow: acpi:  P0: 1400 MHz, 35000 mW, 125 uS, control 009c412f, status 0000012f, vid: 09 fid: 0f SGTC: 10000
> powernow:    FID: 0xf (10.5x [13913MHz])        VID: 0x9 (1.550V)
> powernow: acpi:  P1: 1100 MHz, 15487 mW, 125 uS, control 009c41aa, status 000001aa, vid: 0d fid: 0a SGTC: 10000
> powernow:    FID: 0xa (8.0x [10600MHz]) VID: 0xd (1.350V)
> powernow: acpi:  P2: 800 MHz, 12310 mW, 125 uS, control 009c4266, status 00000266, vid: 13 fid: 06 SGTC: 10000
> powernow:    FID: 0x6 (6.0x [7950MHz])  VID: 0x13 (1.200V)
> powernow: acpi:  P3: 660 MHz, 12310 mW, 125 uS, control 009c4264, status 00000264, vid: 13 fid: 04 SGTC: 10000
> powernow:    FID: 0x4 (5.0x [6625MHz])  VID: 0x13 (1.200V)
> powernow: acpi:  P4: 530 MHz, 10258 mW, 125 uS, control 009c4272, status 00000272, vid: 13 fid: 12 SGTC: 10000
> powernow:    FID: 0x12 (4.0x [5300MHz]) VID: 0x13 (1.200V)
> powernow: Minimum speed 530 MHz. Maximum speed 13913 MHz.

1.) get_ranges() has
		powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10;
  powernow_acpi_init() has
		powernow_table[i].frequency = (fsb * fid_codes[fid]);

2.) minimum_speed, maximum_speed, latency should be cleared before
powernow_acpi_init() is called.

--- linux/arch/i386/kernel/cpu/cpufreq/powernow-k7.c.original	2004-04-14 20:49:45.483959280 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004-04-14 21:01:05.815533160 +0200
@@ -363,7 +363,7 @@
 		vid = pc.bits.vid;
 		fid = pc.bits.fid;
 
-		powernow_table[i].frequency = (fsb * fid_codes[fid]);
+		powernow_table[i].frequency = (fsb * fid_codes[fid]) / 10;
 		powernow_table[i].index = fid; /* lower 8 bits */
 		powernow_table[i].index |= (vid << 8); /* upper 8 bits */
 
@@ -563,6 +563,9 @@
 		result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID);
 		if (result) {
 			printk (KERN_INFO PFX "Trying ACPI perflib\n");
+			maximum_speed = 0;
+			minimum_speed = -1;
+			latency = 0;
 			result = powernow_acpi_init();
 			if (result) {
 				printk (KERN_INFO PFX "ACPI and legacy methods failed\n");

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 18:58       ` Bruno Ducrot
@ 2004-04-14 19:19         ` Dominik Brodowski
  2004-04-15  8:45           ` Bruno Ducrot
  0 siblings, 1 reply; 14+ messages in thread
From: Dominik Brodowski @ 2004-04-14 19:19 UTC (permalink / raw)
  To: Bruno Ducrot; +Cc: Dave Jones, cpufreq


[-- Attachment #1.1: Type: text/plain, Size: 547 bytes --]

On Wed, Apr 14, 2004 at 08:58:42PM +0200, Bruno Ducrot wrote:
> -		powernow_table[i].frequency = (fsb * fid_codes[fid]);
> +		powernow_table[i].frequency = fsb * fid_codes[fid] / 10;

OK, you were faster :-)

> +module_param(powernow_acpi_force,  int, 0444);
> +
> +MODULE_PARM_DESC(powernow_acpi_force, "Force ACPI to be used");
> +

FYI, currently

powernow-k8	has primary mode	ACPI	fallback:	PST
powernow-k7				PST			ACPI
speedstep-centrino			ACPI			builtin-table

and 
acpi-io		only uses		ACPI, of course.	n/a


	Dominik

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB.
  2004-04-14 19:19         ` Dominik Brodowski
@ 2004-04-15  8:45           ` Bruno Ducrot
  0 siblings, 0 replies; 14+ messages in thread
From: Bruno Ducrot @ 2004-04-15  8:45 UTC (permalink / raw)
  To: Dave Jones, cpufreq

On Wed, Apr 14, 2004 at 09:19:36PM +0200, Dominik Brodowski wrote:
> FYI, currently
> 
> powernow-k8	has primary mode	ACPI	fallback:	PST
> powernow-k7				PST			ACPI
> speedstep-centrino			ACPI			builtin-table
> 
> and 
> acpi-io		only uses		ACPI, of course.	n/a
> 

Sound ok for me.

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-04-15  8:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-14 10:36 [PATCH][powernow-k7] correcting SGTC. Timer is based upon FSB Bruno Ducrot
2004-04-14 10:41 ` Dave Jones
2004-04-14 12:18   ` Bruno Ducrot
2004-04-14 12:23     ` Dave Jones
2004-04-14 12:47       ` Bruno Ducrot
2004-04-14 13:28     ` Bruno Ducrot
2004-04-14 13:31       ` Dave Jones
2004-04-14 13:52         ` Bruno Ducrot
2004-04-14 17:44     ` Dave Jones
2004-04-14 18:48       ` Dominik Brodowski
2004-04-14 18:58       ` Bruno Ducrot
2004-04-14 19:19         ` Dominik Brodowski
2004-04-15  8:45           ` Bruno Ducrot
2004-04-14 19:02       ` Dominik Brodowski

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.