]> git.hungrycats.org Git - linux/commitdiff
[PATCH] powernow-k8 frequency handling fix
authorAndrew Morton <akpm@osdl.org>
Sun, 22 Feb 2004 15:07:45 +0000 (07:07 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 22 Feb 2004 15:07:45 +0000 (07:07 -0800)
From: Pavel Machek <pavel@ucw.cz>

In 2.6.3, cleanups arrived, and they got test for invalid frequencies
wrong.

Only first frequency is allowed to be < FID_TABLE_BOTTOM, but due to
bug it cleanups it allowed no frequencies < FID_TABLE_BOTTOM. This
fixes it.

arch/i386/kernel/cpu/cpufreq/powernow-k8.c

index c9f8835fd48a5761afe4e32beb8ffe628740e462..b84559800166e4e231f83d19b084a28aca7078d9 100644 (file)
@@ -521,7 +521,8 @@ static int check_pst_table(struct pst_s *pst, u8 maxvid)
                }
                if ((pst[j].fid > MAX_FID)
                    || (pst[j].fid & 1)
-                   || (pst[j].fid < HI_FID_TABLE_BOTTOM)){
+                   || (j && (pst[j].fid < HI_FID_TABLE_BOTTOM))) {
+                       /* Only first fid is allowed to be in "low" range */
                        printk(KERN_ERR PFX "fid %d invalid : 0x%x\n", j, pst[j].fid);
                        return -EINVAL;
                }