From: Dave Jones <davej@redhat.com>
To: Dominik Brodowski <linux@brodo.de>
Cc: cpufreq@www.linux.org.uk
Subject: Re: [PATCH 5/8] p4_clockmod: detect speed without relying on cpu_khz or user input
Date: Wed, 19 Nov 2003 19:09:46 +0000 [thread overview]
Message-ID: <20031119190946.GB5653@redhat.com> (raw)
In-Reply-To: <20031119183228.GF20576@brodo.de>
On Wed, Nov 19, 2003 at 07:32:28PM +0100, Dominik Brodowski wrote:
> + rdmsr(0x2c, msr_lo, msr_hi);
> +
> + /* printk(KERN_DEBUG PFX "P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); */
> + /* decode the FSB: see IA-32 Intel (C) Architecture Software
> + * Developer's Manual, Volume 3: System Prgramming Guide,
> + * revision #12 in Table B-1: MSRs in the Pentium 4 and
> + * Intel Xeon Processors, on page B-4 and B-5.
> + */
> + if (c->x86_model < 2)
> + fsb = 100 * 1000;
> + else {
> + u8 fsb_code = (msr_lo >> 16) & 0x7;
> + switch (fsb_code) {
> + case 0:
> + fsb = 100 * 1000;
> + break;
> + case 1:
> + fsb = 13333 * 10;
> + break;
> + case 2:
> + fsb = 200 * 1000;
> + break;
> + }
> + }
> +
> + if (!fsb) {
> + printk(KERN_DEBUG PFX "couldn't detect FSB speed. Please send an e-mail to <linux@brodo.de>\n");
> + printk(KERN_DEBUG PFX "P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi);
> + }
patch 4/8 introduced what seems to be the exact same code in the speedstep-lib.
Perhaps it belongs in an fsb.o instead that they can both share ?
I don't mind duplicating it twice in object code, but having two copies
in the source seems a bit silly.
Dave
next prev parent reply other threads:[~2003-11-19 19:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-19 18:32 [PATCH 5/8] p4_clockmod: detect speed without relying on cpu_khz or user input Dominik Brodowski
2003-11-19 19:09 ` Dave Jones [this message]
2003-11-20 18:33 ` Dominik Brodowski
2003-11-21 2:26 ` Dave Jones
2003-11-21 9:56 ` Dominik Brodowski
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=20031119190946.GB5653@redhat.com \
--to=davej@redhat.com \
--cc=cpufreq@www.linux.org.uk \
--cc=linux@brodo.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.