From: Xiao Feng Date: Wed, 13 May 2015 11:27:56 +0000 (+0800) Subject: ddrfreq: fix new_freq=0 when the current load of ddr is between high_load and low_load X-Git-Tag: firefly_0821_release~4158^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70a937f8a3a3880c394de739f4a1955658fcc580;p=firefly-linux-kernel-4.4.55.git ddrfreq: fix new_freq=0 when the current load of ddr is between high_load and low_load Signed-off-by: Xiao Feng --- diff --git a/arch/arm/mach-rockchip/ddr_freq.c b/arch/arm/mach-rockchip/ddr_freq.c index a6c3ab8b8c59..af94e8808d07 100644 --- a/arch/arm/mach-rockchip/ddr_freq.c +++ b/arch/arm/mach-rockchip/ddr_freq.c @@ -204,7 +204,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){ @@ -278,6 +279,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);