All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 16:46:42 +0000	[thread overview]
Message-ID: <CAKohpomK7Y_6aLMA3B+hZrtgYq9U89ihgkbvYWA3BsKN3gJD3g@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1309101740120.16010@axis700.grange>

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]

On 10 September 2013 21:52, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Of course, isn't that what I've written above? reverted a commit and added
> debug - in that order.

Ok, I misread it then :(

> Sure, I can... So, with the performance governor I get
>
> [    1.290000] cpufreq-cpu0 cpufreq-cpu0: Looking up cpu0-supply from device tree
> [    1.290000] cpufreq: trying to register driver generic_cpu0
> [    1.290000] cpufreq: adding CPU 0
> [    1.290000] cpufreq: Adding link for CPU: 1
> [    1.290000] cpufreq: setting new policy for CPU 0: 398667 - 1196000 kHz
> [    1.290000] cpufreq: new min and max freqs are 398667 - 1196000 kHz
> [    1.290000] cpufreq: governor switch
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 4
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 1
> [    1.290000] cpufreq_performance: setting to 1196000 kHz because of event 1
> [    1.290000] cpufreq: __cpufreq_driver_target().1665 1
>
> This is my debug - .transition_ongoing is incremented ^^^^^^^^
>
> [    1.300000] cpufreq: target for CPU 0: 1196000 kHz, relation 1, requested 1196000 kHz

Quite straight forward actually.. Please try attached patch and see if it fixes
your problem.. Which it should if I am not wrong.. I will send it
separately then..

Thanks for your time..

[-- Attachment #2: 0001-fix-target.patch --]
[-- Type: application/octet-stream, Size: 1710 bytes --]

From 4f5379d2c10f2c6354721d9ea5915083dfa29ca7 Mon Sep 17 00:00:00 2001
Message-Id: <4f5379d2c10f2c6354721d9ea5915083dfa29ca7.1378830770.git.viresh.kumar@linaro.org>
From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Tue, 10 Sep 2013 22:02:38 +0530
Subject: [PATCH] fix target()

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 09bbdb0..3d4938b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1655,15 +1655,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 	if (cpufreq_disabled())
 		return -ENODEV;
 
-	write_lock_irqsave(&cpufreq_driver_lock, flags);
-	if (policy->transition_ongoing) {
-		pr_err("%s: Target failed\n", __func__);
-		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-		return -EBUSY;
-	}
-	policy->transition_ongoing++;
-	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-
 	/* Make sure that target_freq is within supported range */
 	if (target_freq > policy->max)
 		target_freq = policy->max;
@@ -1676,6 +1667,15 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 	if (target_freq == policy->cur)
 		return 0;
 
+	write_lock_irqsave(&cpufreq_driver_lock, flags);
+	if (policy->transition_ongoing) {
+		pr_err("%s: Target failed\n", __func__);
+		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+		return -EBUSY;
+	}
+	policy->transition_ongoing++;
+	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+
 	if (cpufreq_driver->target)
 		retval = cpufreq_driver->target(policy, target_freq, relation);
 
-- 
1.7.12.rc2.18.g61b472e


WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Greg KH <greg@kroah.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	SH-Linux <linux-sh@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 22:04:42 +0530	[thread overview]
Message-ID: <CAKohpomK7Y_6aLMA3B+hZrtgYq9U89ihgkbvYWA3BsKN3gJD3g@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1309101740120.16010@axis700.grange>

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]

On 10 September 2013 21:52, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Of course, isn't that what I've written above? reverted a commit and added
> debug - in that order.

Ok, I misread it then :(

> Sure, I can... So, with the performance governor I get
>
> [    1.290000] cpufreq-cpu0 cpufreq-cpu0: Looking up cpu0-supply from device tree
> [    1.290000] cpufreq: trying to register driver generic_cpu0
> [    1.290000] cpufreq: adding CPU 0
> [    1.290000] cpufreq: Adding link for CPU: 1
> [    1.290000] cpufreq: setting new policy for CPU 0: 398667 - 1196000 kHz
> [    1.290000] cpufreq: new min and max freqs are 398667 - 1196000 kHz
> [    1.290000] cpufreq: governor switch
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 4
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 1
> [    1.290000] cpufreq_performance: setting to 1196000 kHz because of event 1
> [    1.290000] cpufreq: __cpufreq_driver_target().1665 1
>
> This is my debug - .transition_ongoing is incremented ^^^^^^^^
>
> [    1.300000] cpufreq: target for CPU 0: 1196000 kHz, relation 1, requested 1196000 kHz

Quite straight forward actually.. Please try attached patch and see if it fixes
your problem.. Which it should if I am not wrong.. I will send it
separately then..

Thanks for your time..

[-- Attachment #2: 0001-fix-target.patch --]
[-- Type: application/octet-stream, Size: 1710 bytes --]

From 4f5379d2c10f2c6354721d9ea5915083dfa29ca7 Mon Sep 17 00:00:00 2001
Message-Id: <4f5379d2c10f2c6354721d9ea5915083dfa29ca7.1378830770.git.viresh.kumar@linaro.org>
From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Tue, 10 Sep 2013 22:02:38 +0530
Subject: [PATCH] fix target()

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 09bbdb0..3d4938b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1655,15 +1655,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 	if (cpufreq_disabled())
 		return -ENODEV;
 
-	write_lock_irqsave(&cpufreq_driver_lock, flags);
-	if (policy->transition_ongoing) {
-		pr_err("%s: Target failed\n", __func__);
-		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-		return -EBUSY;
-	}
-	policy->transition_ongoing++;
-	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-
 	/* Make sure that target_freq is within supported range */
 	if (target_freq > policy->max)
 		target_freq = policy->max;
@@ -1676,6 +1667,15 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 	if (target_freq == policy->cur)
 		return 0;
 
+	write_lock_irqsave(&cpufreq_driver_lock, flags);
+	if (policy->transition_ongoing) {
+		pr_err("%s: Target failed\n", __func__);
+		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+		return -EBUSY;
+	}
+	policy->transition_ongoing++;
+	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+
 	if (cpufreq_driver->target)
 		retval = cpufreq_driver->target(policy, target_freq, relation);
 
-- 
1.7.12.rc2.18.g61b472e


WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Greg KH <greg@kroah.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	SH-Linux <linux-sh@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 22:04:42 +0530	[thread overview]
Message-ID: <CAKohpomK7Y_6aLMA3B+hZrtgYq9U89ihgkbvYWA3BsKN3gJD3g@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1309101740120.16010@axis700.grange>

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]

On 10 September 2013 21:52, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Of course, isn't that what I've written above? reverted a commit and added
> debug - in that order.

Ok, I misread it then :(

> Sure, I can... So, with the performance governor I get
>
> [    1.290000] cpufreq-cpu0 cpufreq-cpu0: Looking up cpu0-supply from device tree
> [    1.290000] cpufreq: trying to register driver generic_cpu0
> [    1.290000] cpufreq: adding CPU 0
> [    1.290000] cpufreq: Adding link for CPU: 1
> [    1.290000] cpufreq: setting new policy for CPU 0: 398667 - 1196000 kHz
> [    1.290000] cpufreq: new min and max freqs are 398667 - 1196000 kHz
> [    1.290000] cpufreq: governor switch
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 4
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 1
> [    1.290000] cpufreq_performance: setting to 1196000 kHz because of event 1
> [    1.290000] cpufreq: __cpufreq_driver_target().1665 1
>
> This is my debug - .transition_ongoing is incremented ^^^^^^^^
>
> [    1.300000] cpufreq: target for CPU 0: 1196000 kHz, relation 1, requested 1196000 kHz

Quite straight forward actually.. Please try attached patch and see if it fixes
your problem.. Which it should if I am not wrong.. I will send it
separately then..

Thanks for your time..

[-- Attachment #2: 0001-fix-target.patch --]
[-- Type: application/octet-stream, Size: 1710 bytes --]

From 4f5379d2c10f2c6354721d9ea5915083dfa29ca7 Mon Sep 17 00:00:00 2001
Message-Id: <4f5379d2c10f2c6354721d9ea5915083dfa29ca7.1378830770.git.viresh.kumar@linaro.org>
From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Tue, 10 Sep 2013 22:02:38 +0530
Subject: [PATCH] fix target()

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 09bbdb0..3d4938b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1655,15 +1655,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 	if (cpufreq_disabled())
 		return -ENODEV;
 
-	write_lock_irqsave(&cpufreq_driver_lock, flags);
-	if (policy->transition_ongoing) {
-		pr_err("%s: Target failed\n", __func__);
-		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-		return -EBUSY;
-	}
-	policy->transition_ongoing++;
-	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-
 	/* Make sure that target_freq is within supported range */
 	if (target_freq > policy->max)
 		target_freq = policy->max;
@@ -1676,6 +1667,15 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 	if (target_freq == policy->cur)
 		return 0;
 
+	write_lock_irqsave(&cpufreq_driver_lock, flags);
+	if (policy->transition_ongoing) {
+		pr_err("%s: Target failed\n", __func__);
+		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+		return -EBUSY;
+	}
+	policy->transition_ongoing++;
+	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
+
 	if (cpufreq_driver->target)
 		retval = cpufreq_driver->target(policy, target_freq, relation);
 
-- 
1.7.12.rc2.18.g61b472e


WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 22:04:42 +0530	[thread overview]
Message-ID: <CAKohpomK7Y_6aLMA3B+hZrtgYq9U89ihgkbvYWA3BsKN3gJD3g@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1309101740120.16010@axis700.grange>

On 10 September 2013 21:52, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Of course, isn't that what I've written above? reverted a commit and added
> debug - in that order.

Ok, I misread it then :(

> Sure, I can... So, with the performance governor I get
>
> [    1.290000] cpufreq-cpu0 cpufreq-cpu0: Looking up cpu0-supply from device tree
> [    1.290000] cpufreq: trying to register driver generic_cpu0
> [    1.290000] cpufreq: adding CPU 0
> [    1.290000] cpufreq: Adding link for CPU: 1
> [    1.290000] cpufreq: setting new policy for CPU 0: 398667 - 1196000 kHz
> [    1.290000] cpufreq: new min and max freqs are 398667 - 1196000 kHz
> [    1.290000] cpufreq: governor switch
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 4
> [    1.290000] cpufreq: __cpufreq_governor for CPU 0, event 1
> [    1.290000] cpufreq_performance: setting to 1196000 kHz because of event 1
> [    1.290000] cpufreq: __cpufreq_driver_target().1665 1
>
> This is my debug - .transition_ongoing is incremented ^^^^^^^^
>
> [    1.300000] cpufreq: target for CPU 0: 1196000 kHz, relation 1, requested 1196000 kHz

Quite straight forward actually.. Please try attached patch and see if it fixes
your problem.. Which it should if I am not wrong.. I will send it
separately then..

Thanks for your time..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-target.patch
Type: application/octet-stream
Size: 1710 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130910/a9e28bba/attachment-0001.obj>

  reply	other threads:[~2013-09-10 16:46 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 15:11 "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too Guennadi Liakhovetski
2013-09-09 15:11 ` Guennadi Liakhovetski
2013-09-09 15:11 ` Guennadi Liakhovetski
2013-09-09 15:11 ` Guennadi Liakhovetski
2013-09-09 20:57 ` Rafael J. Wysocki
2013-09-09 21:08   ` Rafael J. Wysocki
2013-09-09 21:08   ` Rafael J. Wysocki
2013-09-09 21:42   ` Guennadi Liakhovetski
2013-09-09 21:42     ` Guennadi Liakhovetski
2013-09-09 21:42     ` Guennadi Liakhovetski
2013-09-09 23:12     ` Rafael J. Wysocki
2013-09-09 23:12       ` Rafael J. Wysocki
2013-09-09 23:12       ` Rafael J. Wysocki
2013-09-10  1:46       ` Rafael J. Wysocki
2013-09-10  1:46         ` Rafael J. Wysocki
2013-09-10 11:29 ` Viresh Kumar
2013-09-10 11:41   ` Viresh Kumar
2013-09-10 11:29   ` Viresh Kumar
2013-09-10 11:29   ` Viresh Kumar
2013-09-10 11:49   ` Rafael J. Wysocki
2013-09-10 11:49     ` Rafael J. Wysocki
2013-09-10 11:49     ` Rafael J. Wysocki
2013-09-10 11:49     ` Rafael J. Wysocki
2013-09-10 15:14     ` Viresh Kumar
2013-09-10 15:26       ` Viresh Kumar
2013-09-10 15:14       ` Viresh Kumar
2013-09-10 15:14       ` Viresh Kumar
2013-09-10 19:46       ` Rafael J. Wysocki
2013-09-10 19:46         ` Rafael J. Wysocki
2013-09-10 19:46         ` Rafael J. Wysocki
2013-09-10 19:46         ` Rafael J. Wysocki
2013-09-11  8:38         ` Viresh Kumar
2013-09-11  8:50           ` Viresh Kumar
2013-09-11  8:38           ` Viresh Kumar
2013-09-11  8:38           ` Viresh Kumar
2013-09-11 13:18           ` Rafael J. Wysocki
2013-09-11 13:18             ` Rafael J. Wysocki
2013-09-11 13:18             ` Rafael J. Wysocki
2013-09-11 13:18             ` Rafael J. Wysocki
2013-09-12  0:39             ` Viresh Kumar
2013-09-12  0:51               ` Viresh Kumar
2013-09-12  0:39               ` Viresh Kumar
2013-09-12  0:39               ` Viresh Kumar
2013-09-12  0:43               ` Rafael J. Wysocki
2013-09-12  0:43                 ` Rafael J. Wysocki
2013-09-12  0:43                 ` Rafael J. Wysocki
2013-09-12  0:43                 ` Rafael J. Wysocki
2013-09-12  5:36                 ` Viresh Kumar
2013-09-12  5:48                   ` Viresh Kumar
2013-09-12  5:36                   ` Viresh Kumar
2013-09-12  5:36                   ` Viresh Kumar
2013-09-12 10:50                   ` Rafael J. Wysocki
2013-09-12 11:01                     ` Rafael J. Wysocki
2013-09-12 11:01                     ` Rafael J. Wysocki
2013-09-12 11:01                     ` Rafael J. Wysocki
2013-09-12 10:52                     ` Viresh Kumar
2013-09-12 10:52                       ` Viresh Kumar
2013-09-12 10:52                       ` Viresh Kumar
2013-09-12 10:52                       ` Viresh Kumar
2013-09-10 15:12   ` Guennadi Liakhovetski
2013-09-10 15:12     ` Guennadi Liakhovetski
2013-09-10 15:12     ` Guennadi Liakhovetski
2013-09-10 15:12     ` Guennadi Liakhovetski
2013-09-10 15:26     ` Viresh Kumar
2013-09-10 15:38       ` Viresh Kumar
2013-09-10 15:26       ` Viresh Kumar
2013-09-10 15:26       ` Viresh Kumar
2013-09-10 16:22       ` Guennadi Liakhovetski
2013-09-10 16:22         ` Guennadi Liakhovetski
2013-09-10 16:22         ` Guennadi Liakhovetski
2013-09-10 16:22         ` Guennadi Liakhovetski
2013-09-10 16:34         ` Viresh Kumar [this message]
2013-09-10 16:46           ` Viresh Kumar
2013-09-10 16:34           ` Viresh Kumar
2013-09-10 16:34           ` Viresh Kumar
2013-09-10 17:07           ` Guennadi Liakhovetski
2013-09-10 17:07             ` Guennadi Liakhovetski
2013-09-10 17:07             ` Guennadi Liakhovetski
2013-09-10 17:07             ` Guennadi Liakhovetski
2013-09-11  8:06             ` Viresh Kumar
2013-09-11  8:18               ` Viresh Kumar
2013-09-11  8:06               ` Viresh Kumar
2013-09-11  8:06               ` Viresh Kumar
2013-09-11  8:15               ` Guennadi Liakhovetski
2013-09-11  8:15                 ` Guennadi Liakhovetski
2013-09-11  8:15                 ` Guennadi Liakhovetski
2013-09-11  8:15                 ` Guennadi Liakhovetski
2013-09-11  8:39                 ` Viresh Kumar
2013-09-11  8:51                   ` Viresh Kumar
2013-09-11  8:39                   ` Viresh Kumar
2013-09-11  8:39                   ` Viresh Kumar
2013-09-11 13:28                 ` Rafael J. Wysocki
2013-09-11 13:28                   ` Rafael J. Wysocki
2013-09-11 13:28                   ` Rafael J. Wysocki
2013-09-11 13:28                   ` Rafael J. Wysocki
2013-09-12  7:47               ` Guennadi Liakhovetski
2013-09-12  7:47                 ` Guennadi Liakhovetski
2013-09-12  7:47                 ` Guennadi Liakhovetski
2013-09-12  7:47                 ` Guennadi Liakhovetski
2013-09-12  7:51                 ` Viresh Kumar
2013-09-12  7:51                   ` Viresh Kumar
2013-09-12  7:51                   ` Viresh Kumar
2013-09-12  7:51                   ` Viresh Kumar

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=CAKohpomK7Y_6aLMA3B+hZrtgYq9U89ihgkbvYWA3BsKN3gJD3g@mail.gmail.com \
    --to=viresh.kumar@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.