ddrfreq: fix new_freq=0 when the current load of ddr is between high_load and low_load
authorXiao Feng <xf@rock-chips.com>
Wed, 13 May 2015 11:27:56 +0000 (19:27 +0800)
committercl <cl@rock-chips.com>
Thu, 14 May 2015 13:37:46 +0000 (21:37 +0800)
Signed-off-by: Xiao Feng <xf@rock-chips.com>
arch/arm/mach-rockchip/ddr_freq.c

index 7bda5775a8dd61a0c635f264b06f176004a1d0ca..1403ed50e6513a04bd9ad38727af8f3c244b2465 100644 (file)
@@ -198,7 +198,8 @@ static void ddrfreq_mode(bool auto_self_refresh, unsigned long target_rate, char
 
 unsigned long req_freq_by_vop(unsigned long bandwidth)
 {
-       if (time_after(jiffies, vop_bandwidth_update_jiffies+down_rate_delay_ms))
+       if (time_after(jiffies, vop_bandwidth_update_jiffies +
+               msecs_to_jiffies(down_rate_delay_ms)))
                return 0;
 
        if (bandwidth >= 5000){
@@ -272,6 +273,8 @@ static void ddr_auto_freq(void)
 
        vop_req_freq = req_freq_by_vop(vop_bandwidth);
        new_freq = max(vop_req_freq, new_freq);
+       if (new_freq == 0)
+               return;
 
        new_freq = auto_freq_round(new_freq);