cpufreq.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: rjw@rjwysocki.net, mroos@linux.ee
Cc: linaro-kernel@lists.linaro.org, cpufreq@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	srivatsa.bhat@linux.vnet.ibm.com,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] cpufreq: Set CPUFREQ_ASYNC_NOTIFICATION for drivers handling notification
Date: Fri, 25 Apr 2014 13:22:04 +0530	[thread overview]
Message-ID: <c6c53fee017018869c7524a487688edf902c1413.1398412138.git.viresh.kumar@linaro.org> (raw)

CPUFREQ_ASYNC_NOTIFICATION was initially designed for drivers which don't want
core to send notifications for them as they wouldn't finish frequency
transitions in ->target_index().

But there were other kinds of drivers as well who don't have straight forward
implementations of ->target_index() routines and wanted to handle notifications
themselves.

Patch: 7dbf694 (cpufreq: distinguish drivers that do asynchronous notifications)
missed addressing these drivers and that caused these drivers to send double
notifications. Initially cpufreq core sends a notification for these and then
the drivers themselves.

It might not cause a big problem for kernels (3.13/3.14) which doesn't have this
patch in: 12478cf (cpufreq: Make sure frequency transitions are serialized), as
this came in v3.15-rc1. Reason being, we are sending an extra notification for
the same frequency, and so other kernel code that depends on it shouldn't behave
badly.

Above patch broke things as it forces serialization of notifications, so that we
aren't configuring same hardware registers simultaneously.

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Hi Rafael,

This one is for rc3 surely :)

Also, as I mentioned above it might not create any problems for 3.13 and 3.14.
And so I havne't cc'd stable for those kernels. Please add them in case you feel
its still better to get it fixed.

 drivers/cpufreq/longhaul.c    | 1 +
 drivers/cpufreq/powernow-k6.c | 1 +
 drivers/cpufreq/powernow-k7.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index d00e5d1..41f3d28 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -909,6 +909,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
 }
 
 static struct cpufreq_driver longhaul_driver = {
+	.flags	= CPUFREQ_ASYNC_NOTIFICATION,
 	.verify	= cpufreq_generic_frequency_table_verify,
 	.target_index = longhaul_target,
 	.get	= longhaul_get,
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c
index 49f120e..080bbb9 100644
--- a/drivers/cpufreq/powernow-k6.c
+++ b/drivers/cpufreq/powernow-k6.c
@@ -242,6 +242,7 @@ static unsigned int powernow_k6_get(unsigned int cpu)
 }
 
 static struct cpufreq_driver powernow_k6_driver = {
+	.flags		= CPUFREQ_ASYNC_NOTIFICATION,
 	.verify		= cpufreq_generic_frequency_table_verify,
 	.target_index	= powernow_k6_target,
 	.init		= powernow_k6_cpu_init,
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index f911645..fccfc25 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -677,6 +677,7 @@ static int powernow_cpu_exit(struct cpufreq_policy *policy)
 }
 
 static struct cpufreq_driver powernow_driver = {
+	.flags		= CPUFREQ_ASYNC_NOTIFICATION,
 	.verify		= cpufreq_generic_frequency_table_verify,
 	.target_index	= powernow_target,
 	.get		= powernow_get,
-- 
1.7.12.rc2.18.g61b472e

             reply	other threads:[~2014-04-25  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  7:52 Viresh Kumar [this message]
2014-04-25  8:22 ` [PATCH] cpufreq: Set CPUFREQ_ASYNC_NOTIFICATION for drivers handling notification Srivatsa S. Bhat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6c53fee017018869c7524a487688edf902c1413.1398412138.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=rjw@rjwysocki.net \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).