Message ID | 27d5d1fbc05f7cd41a566ca430cbd432804a5acd.1371630975.git.viresh.kumar@linaro.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <patchwork-forward+bncBCRIZROPVQPBBEPDQWHAKGQE52PDQIA@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9BDFF2397B for <linaro@patches.linaro.org>; Wed, 19 Jun 2013 08:53:37 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id d10sf7103694vea.4 for <linaro@patches.linaro.org>; Wed, 19 Jun 2013 01:53: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=XM6VQm73XeAWfkYSWGB48csdIRuQpf41Oa40QWCvlbE=; b=mXfB5aR3wVq+qri9emPgCPc5cwH6xWfyG6dlwjG5wGXwpRTVjwog+WYS5asSjL5Knd JjjgijltF8BEg9R9EOGwczyanKfrCGGr0h2KfStOsjNiRaSf52YTVCycYUc6jCdo+Dfy t5yW137b4BfqZbpesG6kq3wQLREKxmBv0GU6g52gnoF4f3fpn2crZyJhIufZJpKEvdvg +D1klbAyNNdcswVawf7tc1eqlsKd2Lb5bGlqYikBXmnOHwVAQK1EuttOpFkf6ksyGIwf O6u/HyhQYnbmBs4JQSaVpkLBdEFno1J7zlOv0hgW7KANNoQ9GBTistABrDxq0DYnQqDx VUuQ== X-Received: by 10.236.223.162 with SMTP id v32mr1104607yhp.25.1371632017354; Wed, 19 Jun 2013 01:53:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.9 with SMTP id m9ls189079qej.55.gmail; Wed, 19 Jun 2013 01:53:37 -0700 (PDT) X-Received: by 10.52.228.226 with SMTP id sl2mr537945vdc.52.1371632017171; Wed, 19 Jun 2013 01:53:37 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id sc6si6302819vdc.138.2013.06.19.01.53.37 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:53:37 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 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:c02::235; Received: by mail-vb0-f53.google.com with SMTP id p12so3553317vbe.12 for <patchwork-forward@linaro.org>; Wed, 19 Jun 2013 01:53:37 -0700 (PDT) X-Received: by 10.58.45.70 with SMTP id k6mr672742vem.9.1371632017083; Wed, 19 Jun 2013 01:53:37 -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 yu8csp100240veb; Wed, 19 Jun 2013 01:53:36 -0700 (PDT) X-Received: by 10.66.197.165 with SMTP id iv5mr5877281pac.67.1371632016032; Wed, 19 Jun 2013 01:53:36 -0700 (PDT) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [2607:f8b0:400e:c03::22d]) by mx.google.com with ESMTPS id lo1si1498362pab.325.2013.06.19.01.53.35 for <patches@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:53:36 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22d is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c03::22d; Received: by mail-pa0-f45.google.com with SMTP id bi5so4957158pad.4 for <patches@linaro.org>; Wed, 19 Jun 2013 01:53:35 -0700 (PDT) X-Received: by 10.68.36.197 with SMTP id s5mr1891388pbj.23.1371632015614; Wed, 19 Jun 2013 01:53:35 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id ty8sm23879167pac.8.2013.06.19.01.53.28 for <multiple recipients> (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:53:35 -0700 (PDT) From: Viresh Kumar <viresh.kumar@linaro.org> 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 <viresh.kumar@linaro.org>, Borislav Petkov <bp@suse.de> Subject: [PATCH 01/13] cpufreq: acpi: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:22:55 +0530 Message-Id: <27d5d1fbc05f7cd41a566ca430cbd432804a5acd.1371630975.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: <cover.1371630975.git.viresh.kumar@linaro.org> References: <cover.1371630975.git.viresh.kumar@linaro.org> In-Reply-To: <cover.1371630975.git.viresh.kumar@linaro.org> References: <cover.1371630975.git.viresh.kumar@linaro.org> X-Gm-Message-State: ALoCoQmGPkAmM6usCFJh6Oa8W62wItVyY3nD1SQWljnPgTrM74xpEnbL0IYPnVlsP2ZW9jBEtWBQ X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 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: <patchwork-forward.linaro.org> X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe>, <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com> |
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index edc089e..223ddf4 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -494,12 +494,14 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, pr_debug("acpi_cpufreq_target failed (%d)\n", policy->cpu); result = -EAGAIN; - goto out; + freqs.new = freqs.old; } } cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - perf->state = next_perf_state; + + if (!result) + perf->state = next_perf_state; out: return result;
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: Borislav Petkov <bp@suse.de> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- drivers/cpufreq/acpi-cpufreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)