cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruno Ducrot <ducrot@poupinou.org>
To: Dave Jones <davej@redhat.com>
Cc: davej@codemonkey.org.uk, cpufreq@www.linux.org.uk
Subject: Re: [PATCH] powernow-k7: example use for powernow_acpi_init()
Date: Mon, 22 Mar 2004 13:36:14 +0100	[thread overview]
Message-ID: <20040322123614.GP28592@poupinou.org> (raw)
In-Reply-To: <20040322095135.GD29733@redhat.com>

On Mon, Mar 22, 2004 at 09:51:35AM +0000, Dave Jones wrote:
> On Mon, Mar 22, 2004 at 10:38:51AM +0100, Bruno Ducrot wrote:
>  > 
>  > This is an example for using the powernow-k7 ACPI perflib integration,
>  > when the legacy PSB/PST tables are broken.
>  > 
>  > -			printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
>  > -			printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
>  > -			return -EINVAL;
>  > +			ret = powernow_acpi_init();
>  > +			if (ret) {
>  > +				printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
>  > +				printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
>  > +				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
>  > +			}
>  > +			return ret;
>  >  		}
>  >  		p++;
>  >  	}
> 
> Looks good, though also mentioning that the acpi fallback failed is probably
> a good idea too.

Indeed.  And making ACPI perflib in case of known broken BIOS via
DMI may be good (the ASUS should work with that patch, if I read
correctly the DSDT).  There may be though one little annoying thing for
the ASUS bug: FSB will be reported at 100MHz whereas it is at
133MHz, but it's only cosmetic, I hope.

The real trouble is that I don't know how to retrieve FSB on a
athlon/duron: MSR_IA32_EBL_CR_POWERON do not give it :(


 arch/i386/kernel/cpu/cpufreq/powernow-k7.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)


--- linux-2.6.5-rc1/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/03/22 09:50:04	1.3
+++ linux-2.6.5-rc1/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	2004/03/22 12:36:25
@@ -410,11 +410,17 @@ err2:
 err1:
 	kfree(acpi_processor_perf);
 err0:
+	printk(KERN_WARNING PFX "ACPI perflib can not be used in this platform");
 	acpi_processor_perf = NULL;
 	return retval;
 }
 #else
-static int powernow_acpi_init(void) {return -EINVAL;}
+static int powernow_acpi_init(void)
+{
+	printk(KERN_INFO PFX "no support for ACPI processor found."
+	       "  Please recompile your kernel with ACPI processor");
+	return -EINVAL;
+}
 #endif
 
 static int powernow_decode_bios (int maxfid, int startvid)
@@ -427,6 +433,11 @@ static int powernow_decode_bios (int max
 	unsigned int etuple;
 	unsigned int ret;
 
+	if (dmi_broken & BROKEN_CPUFREQ) {
+		printk (KERN_INFO PFX "PSB/PST known to be broken.  Trying ACPI perflib\n");
+		return (powernow_acpi_init());
+	}
+
 	etuple = cpuid_eax(0x80000001);
 	etuple &= 0xf00;
 	etuple |= (c->x86_model<<4)|(c->x86_mask);
@@ -488,10 +499,12 @@ static int powernow_decode_bios (int max
 						p+=2;
 				}
 			}
+			printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
+			printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
+			printk (KERN_INFO PFX "Trying ACPI perflib\n");
 			ret = powernow_acpi_init();
 			if (ret) {
-				printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple);
-				printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n");
+				printk (KERN_INFO PFX "ACPI and leagcy methods failed\n");
 				printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n");
 			}
 			return ret;
@@ -576,10 +589,6 @@ static struct cpufreq_driver powernow_dr
 
 static int __init powernow_init (void)
 {
-	if (dmi_broken & BROKEN_CPUFREQ) {
-		printk (KERN_INFO PFX "Disabled at boot time by DMI,\n");
-		return -ENODEV;
-	}
 	if (check_powernow()==0)
 		return -ENODEV;
 	return cpufreq_register_driver(&powernow_driver);



-- 
Bruno Ducrot

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

  reply	other threads:[~2004-03-22 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-22  9:25 [PATCH] powernow-k7: acpi support Bruno Ducrot
2004-03-22  9:38 ` [PATCH] powernow-k7: example use for powernow_acpi_init() Bruno Ducrot
2004-03-22  9:51   ` Dave Jones
2004-03-22 12:36     ` Bruno Ducrot [this message]
2004-03-22 12:43       ` [PATCH] powernow-k7: stupid bug in a printk introduced Bruno Ducrot
2004-03-22 14:27       ` [PATCH] powernow-k7: example use for powernow_acpi_init() Dave Jones
2004-03-22 18:23         ` Bruno Ducrot
2004-03-22 18:25         ` 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=20040322123614.GP28592@poupinou.org \
    --to=ducrot@poupinou.org \
    --cc=cpufreq@www.linux.org.uk \
    --cc=davej@codemonkey.org.uk \
    --cc=davej@redhat.com \
    /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