From: john stultz <johnstul@us.ibm.com>
To: Dominik Brodowski <linux@dominikbrodowski.de>,
Andrew Morton <akpm@osdl.org>
Cc: Karol Kozimor <sziwan@hell.org.pl>,
dtor_core@ameritech.net, acpi-devel@lists.sourceforge.net,
lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] linux-2.6.5-rc1_cpukhz-fix_A0.patch
Date: Thu, 18 Mar 2004 12:55:53 -0800 [thread overview]
Message-ID: <1079643353.5408.62.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <20040317095033.GA14983@dominikbrodowski.de>
On Wed, 2004-03-17 at 01:50, Dominik Brodowski wrote:
> On Tue, Mar 16, 2004 at 04:46:54PM -0800, john stultz wrote:
> > On Tue, 2004-03-16 at 15:33, Dominik Brodowski wrote:
> > > On Tue, Mar 16, 2004 at 03:28:15PM -0800, john stultz wrote:
> > > > On Tue, 2004-03-16 at 13:42, Karol Kozimor wrote:
> > > > > Thus wrote Daniele Venzano:
> > > > > > > I have a notebook with an Athlon-M CPU. I tried linux 2.6.4 with
> > > > > > > CONFIG_X86_PM_TIMER=y and I noticed that /proc/cpuinfo doesn't get
> > > > > > > updated when I switch frequency (via sysfs, using powernow-k7). The is
> > > > > > > issue seems cosmetic only, CPU frequency changes (watching
> > > > > > > temperature/battery life).
> > > > > > I can confirm, I'm seeing the same behavior. Please note that the
> > > > > > bogomips count gets updated, it's only the frequency that doesn't
> > > > > > change.
> > > > >
> > > > > Same here with a P4-M, follow-up to John and Dmitry.
> > > >
> > > > Hmm. This is untested, but I think this should do the trick.
> > > >
> > > > Dominik: Is there any reason I'm not seeing why cpu_khz should only be
> > > > updated when using the TSC?
> > >
> > > Is cpu_khz always correct (or, at least, nonzero) when we're reaching this
> > > code path?
> >
> > Using the PIT time source, cpu_khz is zero, so maybe it should be
> > conditional on if(cpu_khz)?
>
> That will do the trick.
Patch below.
This small patch insures that cpu_khz is adjusted on cpufreq
notifications even when the tsc timesource is not in use. It fixes the
mostly cosmetic issue when using the ACPI PM timesource of /proc/cpuinfo
not being properly updated when cpu frequency was lowered.
Please let me know if you have any additional feedback.
thanks
-john
diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
--- a/arch/i386/kernel/timers/timer_tsc.c Thu Mar 18 12:50:08 2004
+++ b/arch/i386/kernel/timers/timer_tsc.c Thu Mar 18 12:50:08 2004
@@ -360,8 +360,9 @@
if (variable_tsc)
cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
#ifndef CONFIG_SMP
- if (use_tsc) {
+ if(cpu_khz)
cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new);
+ if (use_tsc) {
if (variable_tsc) {
fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
set_cyc2ns_scale(cpu_khz/1000);
next prev parent reply other threads:[~2004-03-18 20:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040316182257.GA2734@dreamland.darkstar.lan>
[not found] ` <20040316194805.GC20014@picchio.gall.it>
2004-03-16 21:42 ` [ACPI] X86_PM_TIMER: /proc/cpuinfo doesn't get updated Karol Kozimor
2004-03-16 23:19 ` Dmitry Torokhov
2004-03-16 23:32 ` john stultz
2004-03-17 0:30 ` Dmitry Torokhov
2004-03-16 23:28 ` john stultz
2004-03-16 23:33 ` Dominik Brodowski
[not found] ` <1079484413.5408.56.camel@cog.beaverton.ibm.com>
2004-03-17 9:50 ` Dominik Brodowski
2004-03-18 20:55 ` john stultz [this message]
2004-03-17 0:13 ` Karol Kozimor
2004-03-17 0:33 ` Dmitry Torokhov
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=1079643353.5408.62.camel@cog.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=acpi-devel@lists.sourceforge.net \
--cc=akpm@osdl.org \
--cc=dtor_core@ameritech.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.de \
--cc=sziwan@hell.org.pl \
/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
all inboxes | Powered by JetHome®