From patchwork Thu Feb 28 05:38:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 2195521 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id BC53E4006E for ; Thu, 28 Feb 2013 05:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751388Ab3B1FiO (ORCPT ); Thu, 28 Feb 2013 00:38:14 -0500 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:60138 "EHLO LGEMRELSE7Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750856Ab3B1FiJ (ORCPT ); Thu, 28 Feb 2013 00:38:09 -0500 X-AuditID: 9c930197-b7c43ae0000006e1-df-512eed3d0044 Received: from sejong.aot.lge.com ( [10.177.220.181]) by LGEMRELSE7Q.lge.com (Symantec Brightmail Gateway) with SMTP id 53.F3.01761.D3DEE215; Thu, 28 Feb 2013 14:38:06 +0900 (KST) From: Namhyung Kim To: "Rafael J. Wysocki" Cc: LKML , cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, Namhyung Kim , Viresh Kumar Subject: [PATCH -next 2/3] cpufreq: conservative: Break out earlier on the lowest frequency Date: Thu, 28 Feb 2013 14:38:01 +0900 Message-Id: <1362029882-28993-2-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1362029882-28993-1-git-send-email-namhyung@kernel.org> References: <1362029882-28993-1-git-send-email-namhyung@kernel.org> X-Brightmail-Tracker: AAAAAA== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Namhyung Kim If we're on the lowest frequency, no need to calculate new freq. Break out even earlier in this case. Cc: Viresh Kumar Signed-off-by: Namhyung Kim --- drivers/cpufreq/cpufreq_conservative.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 4fd0006b1291..dd2fd9094819 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -93,18 +93,18 @@ static void cs_check_cpu(int cpu, unsigned int load) * safe, we focus 10 points under the threshold. */ if (load < (cs_tuners.down_threshold - 10)) { - freq_target = (cs_tuners.freq_step * policy->max) / 100; - - dbs_info->requested_freq -= freq_target; - if (dbs_info->requested_freq < policy->min) - dbs_info->requested_freq = policy->min; - /* * if we cannot reduce the frequency anymore, break out early */ if (policy->cur == policy->min) return; + freq_target = (cs_tuners.freq_step * policy->max) / 100; + + dbs_info->requested_freq -= freq_target; + if (dbs_info->requested_freq < policy->min) + dbs_info->requested_freq = policy->min; + __cpufreq_driver_target(policy, dbs_info->requested_freq, CPUFREQ_RELATION_H); return;