From patchwork Sun Sep 1 05:26:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19657 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D80B6246B8 for ; Sun, 1 Sep 2013 05:26:13 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oz10sf3997004veb.3 for ; Sat, 31 Aug 2013 22:26:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=m9jvj0tv5UfSRFKIc56Iy+LMSMUCmiO+rJn6rwtdjzs=; b=YZRU+WEJkdEZJqatddhKczXn3t1wj8j2f7+lGvtnan4VTx4LTr3+fRI4QfY658I/Tv u9BUe2nn1J9sa7rJPHunLXv+wmuDQlF0rk7IYycJfAbTwqRNVrQj3qKIDyYKdfr8Jlem 1YXe3wTbiA6cnXHuWFlBYgqmbXRwhS/IzYPRXohnuwJ0tJ9n7sf9IubbotwhCz3BTTDq pSmbKeIk+S2eNYdI1/DvdFgGgjkM1znxmKFWWFIOYi4ADQldRCoqOFqPmchU0tytYkpA MoDxxcnSrOXMK21RVDNCk6qTENI0RrkNV26HjCO1C97VVgRsoyDIjRBqAnH2CyKKlaoq OdlA== X-Received: by 10.236.4.69 with SMTP id 45mr5991266yhi.20.1378013173219; Sat, 31 Aug 2013 22:26:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.231 with SMTP id y7ls1813332qeu.39.gmail; Sat, 31 Aug 2013 22:26:13 -0700 (PDT) X-Received: by 10.58.100.234 with SMTP id fb10mr16649734veb.5.1378013173065; Sat, 31 Aug 2013 22:26:13 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id sk7si1493047vdc.116.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Aug 2013 22:26:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so2222217vcb.8 for ; Sat, 31 Aug 2013 22:26:12 -0700 (PDT) X-Gm-Message-State: ALoCoQnhoZXosFMjJQ+DaB70DTryV3JYqB34p1sSMcQ/cfQPgxj3t1AlzdG/RIGqdfkX8izFPsTY X-Received: by 10.58.119.233 with SMTP id kx9mr16265515veb.3.1378013172601; Sat, 31 Aug 2013 22:26:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp49993vcz; Sat, 31 Aug 2013 22:26:12 -0700 (PDT) X-Received: by 10.68.200.100 with SMTP id jr4mr19064378pbc.0.1378013171530; Sat, 31 Aug 2013 22:26:11 -0700 (PDT) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id xx2si5507185pac.343.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Aug 2013 22:26:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id xa7so3463449pbc.31 for ; Sat, 31 Aug 2013 22:26:10 -0700 (PDT) X-Received: by 10.66.217.166 with SMTP id oz6mr19745027pac.22.1378013170892; Sat, 31 Aug 2013 22:26:10 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id yg3sm8448012pab.16.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 31 Aug 2013 22:26:09 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl, sboyd@codeaurora.org Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 1/2] cpufreq: don't allow governor limits to be changed when it is disabled Date: Sun, 1 Sep 2013 10:56:01 +0530 Message-Id: <085013f4e584e3fef97187bcb349c3fa76942e19.1378012620.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , __cpufreq_governor() returns with -EBUSY when governor is already stopped and we try to stop it again, but when it is stopped we must not allow calls to CPUFREQ_GOV_LIMITS event as well. This patch adds this check in __cpufreq_governor(). Signed-off-by: Viresh Kumar --- Hi Rafael, Its better if we can get these in for 3.11, otherwise we need to get them in the stable tree.. Anyway, we will get these in 3.10 stable tree but that requires us to identify few more patches that will go with these. I will do that later. This must fix the issues reported by Stephen. Tested on my thinkpad over your linux-next branch. drivers/cpufreq/cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5c75e31..f320a20 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1692,8 +1692,9 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, policy->cpu, event); mutex_lock(&cpufreq_governor_lock); - if ((!policy->governor_enabled && (event == CPUFREQ_GOV_STOP)) || - (policy->governor_enabled && (event == CPUFREQ_GOV_START))) { + if ((policy->governor_enabled && (event == CPUFREQ_GOV_START)) || + (!policy->governor_enabled && ((event == CPUFREQ_GOV_LIMITS) || + (event == CPUFREQ_GOV_STOP)))) { mutex_unlock(&cpufreq_governor_lock); return -EBUSY; }