]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 30 Nov 2008 19:43:41 +0000 (11:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 30 Nov 2008 19:43:41 +0000 (11:43 -0800)
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] powernow-k8: ignore out-of-range PstateStatus value
  [CPUFREQ] Documentation: Add Blackfin to list of supported processors

Documentation/cpu-freq/user-guide.txt
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.h

index 6c442d8426b5928569918ebd149f4818c5657ab1..4f3f3840320e30eaa0650e9197725b7d6e811b4e 100644 (file)
@@ -23,6 +23,7 @@ Contents:
 1.3 sparc64
 1.4 ppc
 1.5 SuperH
+1.6 Blackfin
 
 2. "Policy" / "Governor"?
 2.1 Policy
@@ -97,6 +98,17 @@ The following SuperH processors are supported by cpufreq:
 SH-3
 SH-4
 
+1.6 Blackfin
+------------
+
+The following Blackfin processors are supported by cpufreq:
+
+BF522, BF523, BF524, BF525, BF526, BF527, Rev 0.1 or higher
+BF531, BF532, BF533, Rev 0.3 or higher
+BF534, BF536, BF537, Rev 0.2 or higher
+BF561, Rev 0.3 or higher
+BF542, BF544, BF547, BF548, BF549, Rev 0.1 or higher
+
 
 2. "Policy" / "Governor" ?
 ==========================
index d3dcd58b87cd50654d7a065e5d42b05300103f09..7f05f44b97e95c72447c0538f19e06185c0a18b1 100644 (file)
@@ -115,9 +115,20 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data)
        u32 i = 0;
 
        if (cpu_family == CPU_HW_PSTATE) {
-               rdmsr(MSR_PSTATE_STATUS, lo, hi);
-               i = lo & HW_PSTATE_MASK;
-               data->currpstate = i;
+               if (data->currpstate == HW_PSTATE_INVALID) {
+                       /* read (initial) hw pstate if not yet set */
+                       rdmsr(MSR_PSTATE_STATUS, lo, hi);
+                       i = lo & HW_PSTATE_MASK;
+
+                       /*
+                        * a workaround for family 11h erratum 311 might cause
+                        * an "out-of-range Pstate if the core is in Pstate-0
+                        */
+                       if (i >= data->numps)
+                               data->currpstate = HW_PSTATE_0;
+                       else
+                               data->currpstate = i;
+               }
                return 0;
        }
        do {
@@ -1121,6 +1132,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
        }
 
        data->cpu = pol->cpu;
+       data->currpstate = HW_PSTATE_INVALID;
 
        if (powernow_k8_cpu_init_acpi(data)) {
                /*
index ab48cfed4d96ce5629e29f3a21ffd9c3e25d8a21..65cfb5d7f77f17b508024c52891e68e959cab386 100644 (file)
@@ -5,6 +5,19 @@
  *  http://www.gnu.org/licenses/gpl.html
  */
 
+
+enum pstate {
+       HW_PSTATE_INVALID = 0xff,
+       HW_PSTATE_0 = 0,
+       HW_PSTATE_1 = 1,
+       HW_PSTATE_2 = 2,
+       HW_PSTATE_3 = 3,
+       HW_PSTATE_4 = 4,
+       HW_PSTATE_5 = 5,
+       HW_PSTATE_6 = 6,
+       HW_PSTATE_7 = 7,
+};
+
 struct powernow_k8_data {
        unsigned int cpu;
 
@@ -23,7 +36,9 @@ struct powernow_k8_data {
         u32 exttype; /* extended interface = 1 */
 
        /* keep track of the current fid / vid or pstate */
-       u32 currvid, currfid, currpstate;
+       u32 currvid;
+       u32 currfid;
+       enum pstate currpstate;
 
        /* the powernow_table includes all frequency and vid/fid pairings:
         * fid are the lower 8 bits of the index, vid are the upper 8 bits.