From patchwork Wed Jun 19 08:53:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17978 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1A632397B for ; Wed, 19 Jun 2013 08:56:04 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id a11sf7062245qen.0 for ; Wed, 19 Jun 2013 01:56:04 -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=DV1yJ2XZcCr9XIHWZmXJuU+vvUi+mzWBNMEjRKrUTk0=; b=dJKggMhTOmETTUeLa5i1spmECYspLZ7Kmct6uu3WzvijBKD20grYOcJ7DBHLNGwkTs sIraPq1kpM8EEmMLYWnX0qmOzL7Bkwh3SK3ECERndibnT75iPVY5JYhkghivnLhc6uwS 1GMvT+I+acKf0UScfrFLBPGx3sHh/LMdPknRflKN+QPu6E86cT6IqS8gr449gDlsY0b/ dGdm0Ejy3wlD6DefUC/3lgA5Fu1ysO6hW8xkqCgBWVEmywdmHXeBs7R9ETXuj7vLmd95 zXUcDXfRcPUk3at0LunSvq9AvWEIbCM818bO3p0p93wz9GN8sJ0djKMT2E3fZNra5GIs nMHA== X-Received: by 10.236.139.3 with SMTP id b3mr1178152yhj.3.1371632164696; Wed, 19 Jun 2013 01:56:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.132 with SMTP id 4ls207498qee.18.gmail; Wed, 19 Jun 2013 01:56:04 -0700 (PDT) X-Received: by 10.220.98.68 with SMTP id p4mr316260vcn.28.1371632164567; Wed, 19 Jun 2013 01:56:04 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id tq4si6334301vdc.1.2013.06.19.01.56.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:56:04 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f 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::22f; Received: by mail-ve0-f175.google.com with SMTP id da11so3786794veb.20 for ; Wed, 19 Jun 2013 01:56:04 -0700 (PDT) X-Received: by 10.52.22.174 with SMTP id e14mr547472vdf.21.1371632164495; Wed, 19 Jun 2013 01:56:04 -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 yu8csp100301veb; Wed, 19 Jun 2013 01:56:04 -0700 (PDT) X-Received: by 10.66.255.72 with SMTP id ao8mr5777063pad.3.1371632163546; Wed, 19 Jun 2013 01:56:03 -0700 (PDT) Received: from mail-pb0-x22d.google.com (mail-pb0-x22d.google.com [2607:f8b0:400e:c01::22d]) by mx.google.com with ESMTPS id zg2si10007945pbb.225.2013.06.19.01.56.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:56:03 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22d is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::22d; Received: by mail-pb0-f45.google.com with SMTP id mc8so4852169pbc.18 for ; Wed, 19 Jun 2013 01:56:03 -0700 (PDT) X-Received: by 10.66.37.43 with SMTP id v11mr5703498paj.108.1371632163069; Wed, 19 Jun 2013 01:56:03 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id vv6sm23894210pab.6.2013.06.19.01.55.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:56:02 -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 , Mark Brown Subject: [PATCH 11/13] cpufreq: s3c64xx: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:23:05 +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: ALoCoQmvbF4F80z6E0EndP10TmNrcEu4NccdArTDkVH73Pn56tX5tCDfmj/8Mh0K6c+tgW0XgARj X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f 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: Mark Brown Signed-off-by: Viresh Kumar --- drivers/cpufreq/s3c64xx-cpufreq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index 27cacb5..017ade0 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -104,7 +104,8 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, if (ret != 0) { pr_err("Failed to set VDDARM for %dkHz: %d\n", freqs.new, ret); - goto err; + freqs.new = freqs.old; + goto post_notify; } } #endif @@ -113,10 +114,13 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, if (ret < 0) { pr_err("Failed to set rate %dkHz: %d\n", freqs.new, ret); - goto err; + freqs.new = freqs.old; } +post_notify: cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + if (ret) + goto err; #ifdef CONFIG_REGULATOR if (vddarm && freqs.new < freqs.old) {