From patchwork Tue Jun 23 09:53:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ext-eero.nurkkala@nokia.com X-Patchwork-Id: 31944 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5N9sQx3019095 for ; Tue, 23 Jun 2009 09:54:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751147AbZFWJyD (ORCPT ); Tue, 23 Jun 2009 05:54:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751535AbZFWJyD (ORCPT ); Tue, 23 Jun 2009 05:54:03 -0400 Received: from smtp.nokia.com ([192.100.105.134]:43092 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283AbZFWJyB (ORCPT ); Tue, 23 Jun 2009 05:54:01 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n5N9rbqq014780 for ; Tue, 23 Jun 2009 04:54:03 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 23 Jun 2009 12:53:53 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 23 Jun 2009 12:53:52 +0300 Received: from localhost.localdomain ([172.23.118.3]) by mgw-da02.ext.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n5N9rjw0030041; Tue, 23 Jun 2009 12:53:46 +0300 From: ext-eero.nurkkala@nokia.com To: linux-omap@vger.kernel.org Cc: Eero Nurkkala Subject: [PATCH] OMAP: PM: Correct the use of cpufreq Date: Tue, 23 Jun 2009 12:53:29 +0300 Message-Id: <12457508091766-git-send-email-ext-eero.nurkkala@nokia.com> X-Mailer: git-send-email 1.5.2 X-OriginalArrivalTime: 23 Jun 2009 09:53:52.0645 (UTC) FILETIME=[83D42350:01C9F3E8] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Eero Nurkkala Wrong info was used to feed the cpufreq. It is possible now to get below the user defined limit defined at "/cpufreq/scaling_min_freq". With this patch, the user defined limits are being obeyed instead of always using the absolute max and min values supported by the device. Signed-off-by: Eero Nurkkala --- arch/arm/plat-omap/cpu-omap.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index 843e8af..1868c0d 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c @@ -78,10 +78,10 @@ static int omap_target(struct cpufreq_policy *policy, /* Ensure desired rate is within allowed range. Some govenors * (ondemand) will just pass target_freq=0 to get the minimum. */ - if (target_freq < policy->cpuinfo.min_freq) - target_freq = policy->cpuinfo.min_freq; - if (target_freq > policy->cpuinfo.max_freq) - target_freq = policy->cpuinfo.max_freq; + if (target_freq < policy->min) + target_freq = policy->min; + if (target_freq > policy->max) + target_freq = policy->max; freqs.old = omap_getspeed(0); freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;