linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: olof@lixom.net (Olof Johansson)
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, arnd@arndb.de
Subject: [PATCH] pasemi: update ppc_proc_freq from cpufreq driver
Date: Thu, 3 May 2007 23:39:21 -0500	[thread overview]
Message-ID: <20070504043921.GA6022@lixom.net> (raw)
In-Reply-To: <17978.45028.471162.619967@cargo.ozlabs.ibm.com>

Update the global cpu speed variable according to current cpufreq speed,
/proc/cpuinfo reports the actual speed.


Signed-off-by: Olof Johansson <olof@lixom.net>

---

On Fri, May 04, 2007 at 02:00:36PM +1000, Paul Mackerras wrote:
> Olof Johansson writes:
> 
> > On other architectures, the frequency in /proc/cpuinfo moves with cpufreq
> > changes. It makes sense to do the same on powerpc to keep users from
> > getting confused.
> 
> Well, it does on powermac already, because ppc_proc_freq gets
> adjusted...  So at the very least, your patch description needs to be
> changed.
> 
> Do you have a situation where the CPUs in a system can have different
> clock frequencies?  If not, why not just set ppc_proc_freq when the
> frequency changes?

Sure. I'll let the cell guys do the equivalent change on their own.


Index: 2.6.21/arch/powerpc/platforms/pasemi/cpufreq.c
===================================================================
--- 2.6.21.orig/arch/powerpc/platforms/pasemi/cpufreq.c
+++ 2.6.21/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -31,6 +31,7 @@
 #include <asm/hw_irq.h>
 #include <asm/io.h>
 #include <asm/prom.h>
+#include <asm/time.h>
 
 #define SDCASR_REG		0x0100
 #define SDCASR_REG_STRIDE	0x1000
@@ -204,6 +205,8 @@ static int pas_cpufreq_cpu_init(struct c
 	policy->cur = pas_freqs[cur_astate].frequency;
 	policy->cpus = cpu_online_map;
 
+	ppc_proc_freq = policy->cur * 1000ul;
+
 	cpufreq_frequency_table_get_attr(pas_freqs, policy->cpu);
 
 	/* this ensures that policy->cpuinfo_min and policy->cpuinfo_max
@@ -270,6 +273,7 @@ static int pas_cpufreq_target(struct cpu
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 	mutex_unlock(&pas_switch_mutex);
 
+	ppc_proc_freq = freqs.new * 1000ul;
 	return 0;
 }
 

      reply	other threads:[~2007-05-04  4:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27  8:41 [PATCH] powerpc: Show current speed in /proc/cpuinfo Olof Johansson
2007-04-27  9:00 ` Matt Sealey
2007-04-27  9:25   ` Benjamin Herrenschmidt
2007-04-27 18:14   ` Olof Johansson
2007-04-27  9:24 ` Benjamin Herrenschmidt
2007-04-27 17:51   ` Olof Johansson
2007-04-30  3:53 ` [PATCH v2] " Olof Johansson
2007-05-01 23:48   ` Arnd Bergmann
2007-05-04  3:15     ` Olof Johansson
2007-05-04  3:16   ` [PATCH v3] " Olof Johansson
2007-05-04  3:39     ` Stephen Rothwell
2007-05-04  3:46       ` Olof Johansson
2007-05-04  4:00     ` Paul Mackerras
2007-05-04  4:39       ` Olof Johansson [this message]

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=20070504043921.GA6022@lixom.net \
    --to=olof@lixom.net \
    --cc=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).