From patchwork Wed Jun 19 08:53:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17976 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-bk0-f71.google.com (mail-bk0-f71.google.com [209.85.214.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 803802397B for ; Wed, 19 Jun 2013 08:55:38 +0000 (UTC) Received: by mail-bk0-f71.google.com with SMTP id ik8sf4444922bkc.2 for ; Wed, 19 Jun 2013 01:55:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=DK+G36rU32T82qRWf5j8T14EanlzOVMpfUAeUV1nMQ0=; b=HFjbOYeGFNx6jHJpcMZPd5H1hWj2YccVgSgUNvZu1rAhYK2OJcq3PODr9cbsvrT3Pa Fh9/eW2lmKwbeGYGL3IALz9XAKsQaLRrLM5tH492eenABbuB+06ZJ9e3EJZ+Et179uxZ dJ31Sd7Y1irIYH2XFHcqOVRMdyxy25GBWxhMyxCYdY24qB+sRamPxM+M1BFCGeu39KtO ykFHDDLxd3qiIYW3hPSPcIxT0VXE3jBR7juL3MK+sDssQpSPSGguIlHEOT7sTtIAIb4Y en32KN/67boWcZ94xvJa1rX6kKEqWkrSEEpN5N+o0Lkp674poETsXKyJmIYxKuR4vhXG SwIA== X-Received: by 10.180.100.167 with SMTP id ez7mr688942wib.0.1371632137475; Wed, 19 Jun 2013 01:55:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.84.38 with SMTP id v6ls784259wiy.45.canary; Wed, 19 Jun 2013 01:55:37 -0700 (PDT) X-Received: by 10.180.187.17 with SMTP id fo17mr1263060wic.60.1371632137257; Wed, 19 Jun 2013 01:55:37 -0700 (PDT) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [2607:f8b0:400c:c01::22d]) by mx.google.com with ESMTPS id a19si2227942wic.12.2013.06.19.01.55.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:55:37 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22d; Received: by mail-ve0-f173.google.com with SMTP id jw11so3803963veb.4 for ; Wed, 19 Jun 2013 01:55:36 -0700 (PDT) X-Received: by 10.52.120.77 with SMTP id la13mr543062vdb.23.1371632136196; Wed, 19 Jun 2013 01:55:36 -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.58.165.8 with SMTP id yu8csp100288veb; Wed, 19 Jun 2013 01:55:35 -0700 (PDT) X-Received: by 10.68.141.14 with SMTP id rk14mr1928965pbb.1.1371632135392; Wed, 19 Jun 2013 01:55:35 -0700 (PDT) Received: from mail-pb0-x22c.google.com (mail-pb0-x22c.google.com [2607:f8b0:400e:c01::22c]) by mx.google.com with ESMTPS id wx5si10398366pbc.113.2013.06.19.01.55.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:55:35 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22c is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::22c; Received: by mail-pb0-f44.google.com with SMTP id uo1so4855466pbc.17 for ; Wed, 19 Jun 2013 01:55:35 -0700 (PDT) X-Received: by 10.66.150.168 with SMTP id uj8mr5826632pab.34.1371632135012; Wed, 19 Jun 2013 01:55:35 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id ix3sm22248569pbc.37.2013.06.19.01.55.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:55:34 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, dave.martin@arm.com, Viresh Kumar , Dave Jones Subject: [PATCH 09/13] cpufreq: pcc: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:23:03 +0530 Message-Id: <6c9bea6acc4b36e4bee42b973b0c5f66e5d12b1f.1371630975.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmHu7PMb/wkiKfAD/sCxwTNlRlxOvQpeFi9W05Qy+yBPbG3xvGJhGVplPqpbhxnRwkEYa4C X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22d 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: , PRECHANGE and POSTCHANGE notifiers must be called in groups, i.e either both should be called or both shouldn't be. In case we have started PRECHANGE notifier and found an error, we must call POSTCHANGE notifier with freqs.new = freqs.old to guarantee that sequence of calling notifiers is complete. This patch fixes it. Cc: Dave Jones Signed-off-by: Viresh Kumar --- drivers/cpufreq/pcc-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c index 0de0008..1581fcc4 100644 --- a/drivers/cpufreq/pcc-cpufreq.c +++ b/drivers/cpufreq/pcc-cpufreq.c @@ -243,6 +243,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, return 0; cmd_incomplete: + freqs.new = freqs.old; + cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); iowrite16(0, &pcch_hdr->status); spin_unlock(&pcc_lock); return -EINVAL;