Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932803Ab3HGLQb (ORCPT ); Wed, 7 Aug 2013 07:16:31 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:59931 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932434Ab3HGLQ3 (ORCPT ); Wed, 7 Aug 2013 07:16:29 -0400 From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Kukjin Kim Subject: [PATCH] cpufreq: exynos5440: Fix to skip when new frequency same as current Date: Wed, 7 Aug 2013 16:46:11 +0530 Message-Id: <1375874171-16951-1-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1389 Lines: 36 This patch fixes the issue of un-necessary setting the clock controller when the new target frequency is same as the current one. This case usually occurs with governors like ondemand which passes the target frequency as the percentage of average frequency. This check is present in most of the cpufreq driver. Cc: Viresh Kumar Cc: Rafael J. Wysocki Cc: Kukjin Kim Signed-off-by: Amit Daniel Kachhap --- drivers/cpufreq/exynos5440-cpufreq.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 0c74018..d514c15 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c @@ -238,6 +238,9 @@ static int exynos_target(struct cpufreq_policy *policy, freqs.old = dvfs_info->cur_frequency; freqs.new = freq_table[index].frequency; + if (freqs.old == freqs.new) + goto out; + cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); /* Set the target frequency in all C0_3_PSTATE register */ -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/