From patchwork Wed Jun 19 08:53:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17979 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f200.google.com (mail-gh0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B5DD42397B for ; Wed, 19 Jun 2013 08:56:17 +0000 (UTC) Received: by mail-gh0-f200.google.com with SMTP id 10sf4002090ghy.7 for ; Wed, 19 Jun 2013 01:56: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=ZCS9rbozVroIv08bMPvliF3PyAEr3A3rEFjN7JYYL18=; b=h1/HSHIjFHUJKzMhLLqM2ubU8RgeRkpwEE6RcbVahGf7vYfmyXiIWnLSl0QxKe4qB9 KhCl6CBieSm7rbVyzEGxKiCJf5cMMtGzPgz1rzOq6VapX5p0UHJTroUqwFEu1Xuzd9rE JPMQVaQ0bsDpv4b/m6gi3x24QwBm2bluhtsA5jSR1e7XUZRvDME2bHLcokiParVs4RGP FOHtR+k8ow3880+6hbcYkujFywNCScitYLzudfcEfRftpiOWLoJodcNc4rpfIvozwg5J rSgWTyYMeHlCUeUXVPThn/YsJSryppr9PR7ezsOafNWhCSto5ZjAh9ibvosjLIi2ml8B HEiA== X-Received: by 10.236.124.78 with SMTP id w54mr1053826yhh.44.1371632177485; Wed, 19 Jun 2013 01:56:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.105 with SMTP id b9ls184848qeb.34.gmail; Wed, 19 Jun 2013 01:56:17 -0700 (PDT) X-Received: by 10.52.119.233 with SMTP id kx9mr514110vdb.50.1371632177243; Wed, 19 Jun 2013 01:56:17 -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 k12si6320972vcp.41.2013.06.19.01.56.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:56:17 -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 jw11so3804343veb.4 for ; Wed, 19 Jun 2013 01:56:17 -0700 (PDT) X-Received: by 10.58.187.232 with SMTP id fv8mr631986vec.50.1371632177164; Wed, 19 Jun 2013 01:56: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 yu8csp100304veb; Wed, 19 Jun 2013 01:56:16 -0700 (PDT) X-Received: by 10.66.121.202 with SMTP id lm10mr5773577pab.216.1371632176226; Wed, 19 Jun 2013 01:56:16 -0700 (PDT) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [2607:f8b0:400e:c03::236]) by mx.google.com with ESMTPS id qu10si10398869pbc.132.2013.06.19.01.56.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:56:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::236 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c03::236; Received: by mail-pa0-f54.google.com with SMTP id kx10so4938549pab.27 for ; Wed, 19 Jun 2013 01:56:15 -0700 (PDT) X-Received: by 10.66.228.98 with SMTP id sh2mr5655582pac.80.1371632175736; Wed, 19 Jun 2013 01:56:15 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id pm7sm22263733pbb.31.2013.06.19.01.56.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:56: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 , Stephen Warren Subject: [PATCH 12/13] cpufreq: tegra: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:23:06 +0530 Message-Id: <73f480a1fa0d39b1d199e598fa9f9df4a9158d11.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: ALoCoQkvebv1A1o96TRGPhZ9uH9n7ozyQEYO7BS/AFaluEhsBKpP90JJ4A6T0pURg/y/m8/1Mq+1 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: Stephen Warren Signed-off-by: Viresh Kumar Acked-by: Stephen Warren --- drivers/cpufreq/tegra-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index c74c0e1..e74d777 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -138,12 +138,12 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy, if (ret) { pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n", freqs.new); - return ret; + freqs.new = freqs.old; } cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - return 0; + return ret; } static unsigned long tegra_cpu_highest_speed(void)