From patchwork Wed Jun 19 08:53:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17973 Return-Path: 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 7AB512397B for ; Wed, 19 Jun 2013 08:54:57 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id d10sf7105867vea.0 for ; Wed, 19 Jun 2013 01:54:57 -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=8RjhGp4pFSCYTYVwBN4vjotmWM5rRiIzsDRkmIlvMT8=; b=OACbX+5Q/FSjmv4juPLZNOwPkIsEWc7ZNOvIMPb2EE9YHKsWM+H8zVkQ+/q0egif42 CrZ0RmwDM8kEkY13GHlUdM5yEl2rZ807B4IyT+U0JhuRK5okGeuwWP7ftNhLB6xFmqxO 1SA72AZp6OB/23CDITUPYEb9PI+hkE8cWsQwBpvmVFKsQouB2As0ghCbEw+TeQIwwGpn xaDSa7xc4ojGBnUL0uB6f5Ql1FHgGqdfLbsyJ0UWhE+lL+eAhXIcUZDEofwvhUMmbRog 3k0bAKAIzcFskgs0nFxv6U2OYOeQrGLtALWiyG1iJ4LfmbsjF2Zrkh1eM83vl1T0xNs6 iazA== X-Received: by 10.236.200.229 with SMTP id z65mr1124749yhn.18.1371632097188; Wed, 19 Jun 2013 01:54:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.38 with SMTP id or6ls209324qeb.7.gmail; Wed, 19 Jun 2013 01:54:57 -0700 (PDT) X-Received: by 10.52.180.136 with SMTP id do8mr492602vdc.111.1371632096992; Wed, 19 Jun 2013 01:54:56 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id u4si5256828ven.86.2013.06.19.01.54.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:56 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 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::230; Received: by mail-vb0-f48.google.com with SMTP id w15so3489465vbf.21 for ; Wed, 19 Jun 2013 01:54:56 -0700 (PDT) X-Received: by 10.52.37.132 with SMTP id y4mr531316vdj.46.1371632096849; Wed, 19 Jun 2013 01:54:56 -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 yu8csp100267veb; Wed, 19 Jun 2013 01:54:56 -0700 (PDT) X-Received: by 10.66.183.196 with SMTP id eo4mr5716018pac.156.1371632095833; Wed, 19 Jun 2013 01:54:55 -0700 (PDT) Received: from mail-pb0-x233.google.com (mail-pb0-x233.google.com [2607:f8b0:400e:c01::233]) by mx.google.com with ESMTPS id rs6si10393358pbc.152.2013.06.19.01.54.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:55 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::233 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::233; Received: by mail-pb0-f51.google.com with SMTP id um15so4834416pbc.10 for ; Wed, 19 Jun 2013 01:54:55 -0700 (PDT) X-Received: by 10.66.172.197 with SMTP id be5mr5900460pac.50.1371632095311; Wed, 19 Jun 2013 01:54:55 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id ra4sm23883928pab.9.2013.06.19.01.54.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:54 -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 , Kukjin Kim Subject: [PATCH 06/13] cpufreq: exynos: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:23:00 +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: ALoCoQn81KqvA4xMRRtBKssWWjEIeDPQ50QJ3Oi0zTBVdsm68KntQ1kNmMBCvKnvSWGR/EBGztZO X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 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: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/cpufreq/exynos-cpufreq.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 475b4f6..0d32f02 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -113,7 +113,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq) if (ret) { pr_err("%s: failed to set cpu voltage to %d\n", __func__, arm_volt); - goto out; + freqs.new = freqs.old; + goto post_notify; } } @@ -123,14 +124,19 @@ static int exynos_cpufreq_scale(unsigned int target_freq) if (ret) { pr_err("%s: failed to set cpu voltage to %d\n", __func__, safe_arm_volt); - goto out; + freqs.new = freqs.old; + goto post_notify; } } exynos_info->set_freq(old_index, index); +post_notify: cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + if (ret) + goto out; + /* When the new frequency is lower than current frequency */ if ((freqs.new < freqs.old) || ((freqs.new > freqs.old) && safe_arm_volt)) {