From patchwork Wed Jun 19 08:52:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17971 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A99DF2397B for ; Wed, 19 Jun 2013 08:54:17 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id n1sf6655831qcx.7 for ; Wed, 19 Jun 2013 01:54:17 -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=fdH6pLbAgsRAA00cdXMUIfuPtks+BXWxIIUEgwYGzoI=; b=BeUMZ4S10LFU5FoxCQrZQT/vdXvq1HcQ1p77L2VdsvcblIsXiR8fJZxJreRYO5J3Eq qTe5nckse9QMRzUsqrOtk+hEmDDlBFe9cMOEagKbqUeSODt8R1lTzjGW2TbddHgLxZtn D4AY0PAMwBB3HyOn70OdHQeQsrbpHZLs0PEzDOoRCFk9WFjjkz7l+rXJ4Ol5CJAi5iOH OPy//PcphqIeBpLOvkcc8+Dc53CjWQE1hWB7BexCJQImL6oIWaC+gnfNgPwF48E6N7Rr I0u9ts4kgsKXhNknekDlk/bU5qGaJioS54/J2Wak5O26fFS1EWndMkOu5GQkZRT/mlfC Iv3g== X-Received: by 10.236.92.194 with SMTP id j42mr1063366yhf.38.1371632057510; Wed, 19 Jun 2013 01:54:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.74 with SMTP id g10ls231513qey.60.gmail; Wed, 19 Jun 2013 01:54:17 -0700 (PDT) X-Received: by 10.220.66.136 with SMTP id n8mr316264vci.49.1371632057337; Wed, 19 Jun 2013 01:54:17 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id dw4si5245812vcb.119.2013.06.19.01.54.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id m17so3588894vca.37 for ; Wed, 19 Jun 2013 01:54:17 -0700 (PDT) X-Received: by 10.52.90.3 with SMTP id bs3mr513133vdb.64.1371632057262; Wed, 19 Jun 2013 01:54:17 -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 yu8csp100253veb; Wed, 19 Jun 2013 01:54:16 -0700 (PDT) X-Received: by 10.66.150.106 with SMTP id uh10mr5831438pab.118.1371632056317; Wed, 19 Jun 2013 01:54:16 -0700 (PDT) Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [2607:f8b0:400e:c01::229]) by mx.google.com with ESMTPS id ye10si10399437pab.9.2013.06.19.01.54.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::229 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::229; Received: by mail-pb0-f41.google.com with SMTP id rp16so4882937pbb.28 for ; Wed, 19 Jun 2013 01:54:16 -0700 (PDT) X-Received: by 10.68.211.228 with SMTP id nf4mr1880567pbc.26.1371632055940; Wed, 19 Jun 2013 01:54:15 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id v20sm23895287paj.4.2013.06.19.01.54.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:15 -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 , Linus Walleij Subject: [PATCH 04/13] cpufreq: dbx500: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:22:58 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQlalbJha3pICCynYQOXAH+iXOl5uAfbL8HLc7mSbh6J0BqiDbph0oLRSbgw6CfG7XZ5Adqs X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 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: Linus Walleij Signed-off-by: Viresh Kumar Acked-by: Linus Walleij --- drivers/cpufreq/dbx500-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 6ec6539..1fdb02b 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -57,13 +57,13 @@ static int dbx500_cpufreq_target(struct cpufreq_policy *policy, if (ret) { pr_err("dbx500-cpufreq: Failed to set armss_clk to %d Hz: error %d\n", freqs.new * 1000, ret); - return ret; + freqs.new = freqs.old; } /* post change notification */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - return 0; + return ret; } static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu)