All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruno Ducrot <ducrot@poupinou.org>
To: Dominik Brodowski <linux@dominikbrodowski.de>
Cc: davej@redhat.com, cpufreq@www.linux.org.uk
Subject: Re: [PATCH 2.6] powernow-k7 acpi support.
Date: Mon, 9 Feb 2004 19:58:31 +0100	[thread overview]
Message-ID: <20040209185831.GG13262@poupinou.org> (raw)
In-Reply-To: <20040209180553.GA30914@dominikbrodowski.de>

On Mon, Feb 09, 2004 at 07:05:53PM +0100, Dominik Brodowski wrote:
> On Mon, Feb 09, 2004 at 06:50:00PM +0100, Bruno Ducrot wrote:
> > 
> > How about that one?
> 
> Looks much better, IMO.
> 
> >  By now, I'm a little puzzled with the fsb stuff,
> > though.  A first idea may be to look into what say ACPI about the
> > frequency, and deduce the fsb from, but I don't like it.
> 
> So you wouldn't like
> 
> 	fsb = (acpi_processor_perf->states[i].core_frequency * 10) / fid_codes[fid]
> 

Ok, you win.  That one is ok ?


--- linux-2.6.3-bk-acpi/arch/i386/kernel/cpu/cpufreq/powernow-k7.c.orig	2004-02-09 19:39:41.000000000 +0100
+++ linux-2.6.3-bk-acpi/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004-02-09 19:58:28.000000000 +0100
@@ -333,6 +333,7 @@
 {
 	int i;
 	int retval = 0;
+	union powernow_acpi_control_t pc;
 
 	if (acpi_processor_perf != NULL)
 		return -EINVAL;
@@ -378,12 +379,22 @@
 
 	memset(powernow_table, 0, ((number_scales + 1) * sizeof(struct cpufreq_frequency_table)));
 
-	fsb = 100;	/* XXX fix me */
+	pc.val = (unsigned long) acpi_processor_perf->states[0].control;
+	fsb = (10 * (u32) acpi_processor_perf->states[0].core_frequency) / (fid_codes[pc.bits.fid]);
+	if (fsb > 133)
+		fsb = 133;
+	if (fsb < 100)
+		fsb = 100;
+
+	if (100 + 133 < 2*fsb)
+		fsb = 133;
+	else
+		fsb = 100;
+
 	latency = 0;
 
 	for (i = 0; i < number_scales; i++) {
 		u8 fid, vid;
-		union powernow_acpi_control_t pc;
 		unsigned int speed;
 
 		pc.val = (unsigned long) acpi_processor_perf->states[i].control;


-- 
Bruno Ducrot

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

  parent reply	other threads:[~2004-02-09 18:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09 13:26 [PATCH 2.6] powernow-k7 acpi support Bruno Ducrot
2004-02-09 15:05 ` Dominik Brodowski
2004-02-09 15:20   ` Bruno Ducrot
2004-02-09 17:37     ` Bruno Ducrot
2004-02-09 17:50   ` Bruno Ducrot
2004-02-09 18:05     ` Dominik Brodowski
2004-02-09 18:29       ` Bruno Ducrot
2004-02-09 18:58       ` Bruno Ducrot [this message]
2004-02-10  9:03         ` Dominik Brodowski
2004-02-10 18:08           ` Dave Jones
2004-02-10 20:05             ` Bruno Ducrot

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=20040209185831.GG13262@poupinou.org \
    --to=ducrot@poupinou.org \
    --cc=cpufreq@www.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=linux@dominikbrodowski.de \
    /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.