From patchwork Wed Jun 19 08:52:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17970 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C73212397B for ; Wed, 19 Jun 2013 08:54:04 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cr7sf685397qab.9 for ; Wed, 19 Jun 2013 01:54: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=hDhmqQflz1b05PF0TRuxpeoVw/Fv+MmOhLRNmbCMpAE=; b=SFC3EKr4tjgtm1hke1g0uHKu78yw+0hxuO8rsU8oJcADFaxntVGQP37UpPwZKy0GGx Fiic0w+dgRNFLjV6gB+eNpEgHevrK6HJkrNHs542PWZqs6fjg/rUKyP7iw5UC4FLg7Fg qW8SKqPoybCHWVmQe6ibqCEsVh+6vnXg0u+csgwE/XnN3qNfFUi2Z1jxBWzcKgDjy4fd wxh4f32IOeNv/GN/9Vhzq3ftjCxJWSb1Xr8FCUtHyQ9IbbCfzJq8ZAyoFwe9gNiMp0Hm QsFyejLhLQdDpfDI8lEntIVNU1dSmHtBXEsUl501+1VvFZpg4DU5r5c2MOFdKOl1Gc1U jXkA== X-Received: by 10.224.129.196 with SMTP id p4mr2644251qas.6.1371632044608; Wed, 19 Jun 2013 01:54:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.138 with SMTP id k10ls199924qek.15.gmail; Wed, 19 Jun 2013 01:54:04 -0700 (PDT) X-Received: by 10.52.178.98 with SMTP id cx2mr523283vdc.75.1371632044451; Wed, 19 Jun 2013 01:54:04 -0700 (PDT) Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com [2607:f8b0:400c:c02::231]) by mx.google.com with ESMTPS id qu17si5256080vec.120.2013.06.19.01.54.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:04 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::231 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::231; Received: by mail-vb0-f49.google.com with SMTP id 12so3497738vbf.22 for ; Wed, 19 Jun 2013 01:54:04 -0700 (PDT) X-Received: by 10.58.168.208 with SMTP id zy16mr661766veb.3.1371632044343; Wed, 19 Jun 2013 01:54: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 yu8csp100249veb; Wed, 19 Jun 2013 01:54:03 -0700 (PDT) X-Received: by 10.66.197.227 with SMTP id ix3mr5813420pac.105.1371632043402; Wed, 19 Jun 2013 01:54:03 -0700 (PDT) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [2607:f8b0:400e:c03::22c]) by mx.google.com with ESMTPS id iw6si10393127pac.72.2013.06.19.01.54.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54:03 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22c is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c03::22c; Received: by mail-pa0-f44.google.com with SMTP id lj1so4944066pab.31 for ; Wed, 19 Jun 2013 01:54:03 -0700 (PDT) X-Received: by 10.66.149.170 with SMTP id ub10mr5676330pab.206.1371632043016; Wed, 19 Jun 2013 01:54:03 -0700 (PDT) Received: from localhost ([106.198.29.238]) by mx.google.com with ESMTPSA id yj2sm22236119pbb.40.2013.06.19.01.53.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 01:54: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 , Sekhar Nori Subject: [PATCH 03/13] cpufreq: davinci: call CPUFREQ_POSTCHANGE notfier in error cases Date: Wed, 19 Jun 2013 14:22:57 +0530 Message-Id: <6e65891cd3e33c5db94563a387832ae648ef0d8c.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: ALoCoQlFvGb/2jTxyRP1hXuzy3SDM/LMmQIb2FrqRXeNdofcfGxFagz7qwZWhL0VdyqBouech5di X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::231 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. Davinci driver was taking care of it but frequency isn't restored to freqs.old. This patch fixes it. Cc: Sekhar Nori Signed-off-by: Viresh Kumar Acked-by: Sekhar Nori --- drivers/cpufreq/davinci-cpufreq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c index c33c76c..551dd65 100644 --- a/drivers/cpufreq/davinci-cpufreq.c +++ b/drivers/cpufreq/davinci-cpufreq.c @@ -114,6 +114,9 @@ static int davinci_target(struct cpufreq_policy *policy, pdata->set_voltage(idx); out: + if (ret) + freqs.new = freqs.old; + cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); return ret;