]> git.hungrycats.org Git - linux/commitdiff
[PATCH] pmac_cpufreq msleep cleanup/fixes
authorNishanth Aravamudan <nacc@us.ibm.com>
Fri, 22 Oct 2004 04:11:36 +0000 (21:11 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 22 Oct 2004 04:11:36 +0000 (21:11 -0700)
Uses msleep() instead of schedule_timeout() to guarantee the task delays
as expected.  Two of the changes are reworks of previous msleep() calls
which unnecessarily added a jiffy to the parameter.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc/platforms/pmac_cpufreq.c

index 536d3829b092da14a294ad2d469a2243ec11b585..c50aa7fd195827b45adabac8cf9bab12cc153cb0 100644 (file)
@@ -141,7 +141,7 @@ static int __pmac dfs_set_cpu_speed(int low_speed)
                /* ramping up, set voltage first */
                pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
                /* Make sure we sleep for at least 1ms */
-               msleep(1 + jiffies_to_msecs(1));
+               msleep(1);
        }
 
        /* set frequency */
@@ -150,7 +150,7 @@ static int __pmac dfs_set_cpu_speed(int low_speed)
        if (low_speed == 1) {
                /* ramping down, set voltage last */
                pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
-               msleep(1 + jiffies_to_msecs(1));
+               msleep(1);
        }
 
        return 0;
@@ -167,8 +167,7 @@ static int __pmac gpios_set_cpu_speed(int low_speed)
        if (low_speed == 0) {
                pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
                /* Delay is way too big but it's ok, we schedule */
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(HZ/100);
+               msleep(10);
        }
 
        /* Set frequency */
@@ -185,8 +184,7 @@ static int __pmac gpios_set_cpu_speed(int low_speed)
        if (low_speed == 1) {
                pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
                /* Delay is way too big but it's ok, we schedule */
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(HZ/100);
+               msleep(10);
        }
 
 #ifdef DEBUG_FREQ