From patchwork Wed Aug 7 11:16:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2840224 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 079749F494 for ; Wed, 7 Aug 2013 11:17:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50D32201CD for ; Wed, 7 Aug 2013 11:17:03 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14928201BE for ; Wed, 7 Aug 2013 11:17:02 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V71jb-00057F-OF; Wed, 07 Aug 2013 11:16:56 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V71jZ-00054Q-HN; Wed, 07 Aug 2013 11:16:53 +0000 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V71jW-00053k-Kx for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2013 11:16:52 +0000 Received: by mail-pd0-f171.google.com with SMTP id bv13so1269609pdb.2 for ; Wed, 07 Aug 2013 04:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=11hAObFAR5ZucWNSSHwHt2TpWAZ36Lu6ZnZqpZ1RO+s=; b=lv1fS2JJFgQ8dk3ohduK2W4rZn1SzJU13l0cS+IZyQPr8TCbQCDzr27oSjv3uAFhay 2bD7bvEwCw9lHzw2To+a2FX7RLfWrLZD254Mp/c1v3yJ73FWwCG50s6glm6EP9DVWHGl 3BpCYHyC80vy15he5OA6Cz7bHWAt8VFjd2KbRVJ6LY11gEstvObSYYKjx6RVIGr+U99U VDouNluKShOHLAB7WWDitQKqWWb5U9D5Nk5tLkVIpLy6SJgZSNALzxS60R+tdJ2jChNU q0kyC5nLh87wDpe98f7PRFE3lRqGUSqTB4N8yzBQUBE87dcMmbslYmxnt87xMC1PAMjf D3vA== X-Received: by 10.68.99.98 with SMTP id ep2mr147178pbb.6.1375874188410; Wed, 07 Aug 2013 04:16:28 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id ll5sm9831810pab.19.2013.08.07.04.16.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 07 Aug 2013 04:16:27 -0700 (PDT) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130807_071650_764199_A2E6F453 X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -1.9 (-) Cc: linux-samsung-soc@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Kukjin Kim , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */