From patchwork Thu Jun 25 17:08:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 32427 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 n5PH8SPC011647 for ; Thu, 25 Jun 2009 17:08:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460AbZFYRIW (ORCPT ); Thu, 25 Jun 2009 13:08:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753130AbZFYRIW (ORCPT ); Thu, 25 Jun 2009 13:08:22 -0400 Received: from wf-out-1314.google.com ([209.85.200.173]:49738 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753281AbZFYRIV (ORCPT ); Thu, 25 Jun 2009 13:08:21 -0400 Received: by wf-out-1314.google.com with SMTP id 26so580213wfd.4 for ; Thu, 25 Jun 2009 10:08:25 -0700 (PDT) Received: by 10.142.177.13 with SMTP id z13mr914198wfe.79.1245949704950; Thu, 25 Jun 2009 10:08:24 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 22sm8946043wfd.28.2009.06.25.10.08.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Jun 2009 10:08:24 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Cc: linux-omap@vger.kernel.org, Eero Nurkkala Subject: [PATCH 12/11] OMAP: PM: CPUfreq: obey min/max settings of policy Date: Thu, 25 Jun 2009 10:08:22 -0700 Message-Id: <1245949702-26243-1-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.2 In-Reply-To: <1245948124-24111-1-git-send-email-khilman@deeprootsystems.com> References: <1245948124-24111-1-git-send-email-khilman@deeprootsystems.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Eero Nurkkala Use the min/max settings from CPUfreq policy rather than processor defined min/max settings. Without this patch, it's possible to scale frequency outside the current policy range. Signed-off-by: Eero Nurkkala Signed-off-by: Kevin Hilman --- 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;