mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* PowerNow-K8 and Winchester CPUs
@ 2005-03-14 16:24 Vojtech Pavlik
  2005-03-14 17:18 ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Vojtech Pavlik @ 2005-03-14 16:24 UTC (permalink / raw)
  To: davej, linux, pavel, linux-kernel

Hi!

I have a machine with an Athlon64 with a Winchester core. It has a max
frequency of 2GHz, vid 0x6. The maximum vid allowed is 0x4. It has an
intermediate vid 0x8. RVO is 3.

When transitioning (phase1) from vid 0x8 to vid 0x6, it first increases
the vid to 6, and then proceeds increasing it three more steps. This of
course fails, because it overflows the maximum allowed vid 0x4.

My first attempt to fix this was to limit the vid to the max vid while
doing the rvo bump-up.

However, I believe that the real reason for the problem is that the
condition to start doing the rvo bump is wrong.

This patch should fix it:

diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-03-14 17:20:17 +01:00
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-03-14 17:20:17 +01:00
@@ -286,7 +286,7 @@
 			return 1;
 	}
 
-	while ((rvosteps > 0)  && ((data->rvo + data->currvid) > reqvid)) {
+	while ((rvosteps > 0) && ((data->currvid - data->rvo) > reqvid)) {
 		if (data->currvid == 0) {
 			rvosteps = 0;
 		} else {

if I understand the original intent of the second test in the while()
statement. 

Any comments? Is my understanding of that bit of code correct?

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

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

* Re: PowerNow-K8 and Winchester CPUs
  2005-03-14 16:24 PowerNow-K8 and Winchester CPUs Vojtech Pavlik
@ 2005-03-14 17:18 ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2005-03-14 17:18 UTC (permalink / raw)
  To: Vojtech Pavlik, paul.devriendt; +Cc: davej, linux, linux-kernel

Hi!

Paul, can you comment on this one? I know that pn-k8 logic is quite
tricky... And BIOS tables are often wrong.
								Pavel

> I have a machine with an Athlon64 with a Winchester core. It has a max
> frequency of 2GHz, vid 0x6. The maximum vid allowed is 0x4. It has an
> intermediate vid 0x8. RVO is 3.
> 
> When transitioning (phase1) from vid 0x8 to vid 0x6, it first increases
> the vid to 6, and then proceeds increasing it three more steps. This of
> course fails, because it overflows the maximum allowed vid 0x4.
> 
> My first attempt to fix this was to limit the vid to the max vid while
> doing the rvo bump-up.
> 
> However, I believe that the real reason for the problem is that the
> condition to start doing the rvo bump is wrong.
> 
> This patch should fix it:
> 
> diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
> --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-03-14 17:20:17 +01:00
> +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-03-14 17:20:17 +01:00
> @@ -286,7 +286,7 @@
>  			return 1;
>  	}
>  
> -	while ((rvosteps > 0)  && ((data->rvo + data->currvid) > reqvid)) {
> +	while ((rvosteps > 0) && ((data->currvid - data->rvo) > reqvid)) {
>  		if (data->currvid == 0) {
>  			rvosteps = 0;
>  		} else {
> 
> if I understand the original intent of the second test in the while()
> statement. 
> 
> Any comments? Is my understanding of that bit of code correct?
> 

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

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

* RE: PowerNow-K8 and Winchester CPUs
@ 2005-03-14 17:59 Devriendt, Paul
  0 siblings, 0 replies; 3+ messages in thread
From: Devriendt, Paul @ 2005-03-14 17:59 UTC (permalink / raw)
  To: Pavel Machek, Vojtech Pavlik; +Cc: davej, linux, linux-kernel, Langsdorf, Mark

Hi Pavel, 

This is similar to the Sempron patch I put out a while ago -
that was a similar problem. Let Mark and I think about it for
a couple of days. I think there is a better way to fix this.
There are some new fields in the status register in newer
parts to give things like maxvid, and we are not using them
at present. They were added in a manner compatible with the
older parts. I think we may have a better solution to use
the new fields.

Paul.

> -----Original Message-----
> From: Pavel Machek [mailto:pavel@suse.cz] 
> Sent: Monday, March 14, 2005 11:18 AM
> To: Vojtech Pavlik; Devriendt, Paul
> Cc: davej@codemonkey.org.uk; linux@brodo.de; 
> linux-kernel@vger.kernel.org
> Subject: Re: PowerNow-K8 and Winchester CPUs
> 
> Hi!
> 
> Paul, can you comment on this one? I know that pn-k8 logic is quite
> tricky... And BIOS tables are often wrong.
> 								Pavel
> 
> > I have a machine with an Athlon64 with a Winchester core. 
> It has a max
> > frequency of 2GHz, vid 0x6. The maximum vid allowed is 0x4. 
> It has an
> > intermediate vid 0x8. RVO is 3.
> > 
> > When transitioning (phase1) from vid 0x8 to vid 0x6, it 
> first increases
> > the vid to 6, and then proceeds increasing it three more 
> steps. This of
> > course fails, because it overflows the maximum allowed vid 0x4.
> > 
> > My first attempt to fix this was to limit the vid to the 
> max vid while
> > doing the rvo bump-up.
> > 
> > However, I believe that the real reason for the problem is that the
> > condition to start doing the rvo bump is wrong.
> > 
> > This patch should fix it:
> > 
> > diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c 
> b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
> > --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	
> 2005-03-14 17:20:17 +01:00
> > +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	
> 2005-03-14 17:20:17 +01:00
> > @@ -286,7 +286,7 @@
> >  			return 1;
> >  	}
> >  
> > -	while ((rvosteps > 0)  && ((data->rvo + data->currvid) 
> > reqvid)) {
> > +	while ((rvosteps > 0) && ((data->currvid - data->rvo) > 
> reqvid)) {
> >  		if (data->currvid == 0) {
> >  			rvosteps = 0;
> >  		} else {
> > 
> > if I understand the original intent of the second test in 
> the while()
> > statement. 
> > 
> > Any comments? Is my understanding of that bit of code correct?
> > 
> 
> -- 
> People were complaining that M$ turns users into beta-testers...
> ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
> 
> 


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

end of thread, other threads:[~2005-03-14 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-14 16:24 PowerNow-K8 and Winchester CPUs Vojtech Pavlik
2005-03-14 17:18 ` Pavel Machek
2005-03-14 17:59 Devriendt, Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®