Commit 09ece1af authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Fix powernow-k7 hang.

Some laptops don't like jumping from (for eg) 800MHz->1200MHz, but
will happily go from 800->1000->1200. The problem is caused by us
changing the FID and the VID at the same time. The spec says we have
to change them seperately. This actually buys us something extra anyway,
as we can now set the FID lazily as well as the VID.
parent 5ac8451a
......@@ -236,20 +236,24 @@ static void change_speed (unsigned int index)
if (have_a0 == 1) /* A0 errata 5 */
__asm__("\tcli\n");
rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
fidvidctl.bits.SGTC = latency; /* Stop grant timeout counter */
fidvidctl.bits.FID = fid;
fidvidctl.bits.FIDC = 1;
/* First change the frequency. */
if (fidvidctl.bits.FID != fid) {
rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
fidvidctl.bits.SGTC = latency; /* Stop grant timeout counter */
fidvidctl.bits.FID = fid;
fidvidctl.bits.FIDC = 1;
wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
}
/* Set the voltage lazily. Ie, only do voltage transition
if its changed since last time (Some speeds have the same voltage) */
/* Now change voltage. */
if (fidvidctl.bits.VID != vid) {
rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
fidvidctl.bits.VID = vid;
fidvidctl.bits.VIDC = 1;
wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
}
wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
if (have_a0 == 1)
__asm__("\tsti\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment