From patchwork Mon Jun 24 13:31:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f198.google.com (mail-gh0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 24E5D25CFE for ; Mon, 24 Jun 2013 13:32:03 +0000 (UTC) Received: by mail-gh0-f198.google.com with SMTP id r13sf11427186ghr.1 for ; Mon, 24 Jun 2013 06:32:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:in-reply-to:references:date:message-id:subject:from:to :cc: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 :content-type; bh=HGBhnJ/v9Wz3eSNR1QKVjjftXCKud1b/a5yeC1YNCJw=; b=BVE8hDpDRG5yPyTM5/6GcnuTZpgpz6pJD11RAOXGwM/Ejv/0tfDW+gxlJ7X/yFHKEj eFRXIZZS4jy2+EM9W5baauK7mdEYwZcFBbuOyI/J++XSxwMfWBua9Y7UelxngSQTqpqL eFmEdgMBz1OwlhBQHDwaHHAV2QB1iJENSFznZ4lsCq8M7hy8IpcLq5F5X2YnAFdBIRwJ Hd/egzf6efNZdmZCeBqEsG2robiIN0K+JdBf42WR1PBM5KDg93472gRFGbmtFvVLHSGa B3jCqjq52cQmLEbnNtqZh4jy/aq1id3Q+ScA/uZQG42UYUSxFIM8TqdtCn0ZWK6220P7 khHA== X-Received: by 10.236.156.234 with SMTP id m70mr12460270yhk.37.1372080722337; Mon, 24 Jun 2013 06:32:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.195 with SMTP id ec3ls2098256qeb.13.gmail; Mon, 24 Jun 2013 06:32:02 -0700 (PDT) X-Received: by 10.58.240.6 with SMTP id vw6mr11467863vec.16.1372080722020; Mon, 24 Jun 2013 06:32:02 -0700 (PDT) Received: from mail-vb0-x22a.google.com (mail-vb0-x22a.google.com [2607:f8b0:400c:c02::22a]) by mx.google.com with ESMTPS id ur15si4862104veb.70.2013.06.24.06.32.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:32:01 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22a 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::22a; Received: by mail-vb0-f42.google.com with SMTP id i3so8164522vbh.1 for ; Mon, 24 Jun 2013 06:32:01 -0700 (PDT) X-Received: by 10.220.110.78 with SMTP id m14mr11287813vcp.53.1372080721623; Mon, 24 Jun 2013 06:32:01 -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 yu8csp27705veb; Mon, 24 Jun 2013 06:32:00 -0700 (PDT) X-Received: by 10.60.97.230 with SMTP id ed6mr5481056oeb.97.1372080720412; Mon, 24 Jun 2013 06:32:00 -0700 (PDT) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [2607:f8b0:4003:c01::22c]) by mx.google.com with ESMTPS id n7si2850790oep.44.2013.06.24.06.32.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:32:00 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4003:c01::22c is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:4003:c01::22c; Received: by mail-ob0-f172.google.com with SMTP id wo10so10858502obc.3 for ; Mon, 24 Jun 2013 06:32:00 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.171.74 with SMTP id as10mr8049529obc.70.1372080719920; Mon, 24 Jun 2013 06:31:59 -0700 (PDT) Received: by 10.182.96.138 with HTTP; Mon, 24 Jun 2013 06:31:59 -0700 (PDT) In-Reply-To: <2165396.dF1lQyPRVT@vostro.rjw.lan> References: <11846442.bozySFIXTh@vostro.rjw.lan> <2165396.dF1lQyPRVT@vostro.rjw.lan> Date: Mon, 24 Jun 2013 19:01:59 +0530 Message-ID: Subject: Re: [PATCH 13/13] cpufreq: make sure frequency transitions are serialized From: Viresh Kumar To: "Rafael J. Wysocki" 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 X-Gm-Message-State: ALoCoQnUczhYh7NhSltnQ0eM8YwTqsIWxcAq8wv99ofG3qCxhKn7YbH8ls1sySNvw/2c43pMimT0 X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22a 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: , On 24 June 2013 19:03, Rafael J. Wysocki wrote: > Looks OK, but since transition_ongoing is either 0 or 1 now, as far as I can > say, it would be better to make it a bool and use = true/false instead of > ++/-- I suppose. Another fixup: * which is not equal to what the cpufreq core thinks is @@ -296,7 +296,7 @@ void __cpufreq_notify_transition(struct cpufreq_policy *policy, "No frequency transition in progress\n")) return; - transition_ongoing--; + transition_ongoing = false; adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6ca7eac..49d942a 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -108,7 +108,7 @@ static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list); static struct srcu_notifier_head cpufreq_transition_notifier_list; /* Tracks status of transition */ -static int transition_ongoing; +static bool transition_ongoing; static bool init_cpufreq_transition_notifier_list_called; static int __init init_cpufreq_transition_notifier_list(void) @@ -271,7 +271,7 @@ void __cpufreq_notify_transition(struct cpufreq_policy *policy, "In middle of another frequency transition\n")) return; - transition_ongoing++; + transition_ongoing = true; /* detect if the driver reported a value as "old frequency"