Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / tools / power / cpupower / utils / helpers / amd.c
index 65beaee..7c4f83a 100644 (file)
@@ -33,7 +33,7 @@ union msr_pstate {
                unsigned vid:8;
                unsigned iddval:8;
                unsigned idddiv:2;
-               unsigned res1:30;
+               unsigned res1:31;
                unsigned en:1;
        } fam17h_bits;
        unsigned long long val;
@@ -119,6 +119,11 @@ int decode_pstates(unsigned int cpu, unsigned int cpu_family,
                }
                if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val))
                        return -1;
+               if ((cpu_family == 0x17) && (!pstate.fam17h_bits.en))
+                       continue;
+               else if (!pstate.bits.en)
+                       continue;
+
                pstates[i] = get_cof(cpu_family, pstate);
        }
        *no = i;