Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360934 > unrolled thread

[PATCH 5/5] cpufreq: acpi-cpufreq: Clean up hot plug notifier callback.

Started byRichard Cochran <rcochran@linutronix.de>
First post2016-03-18 22:30 +0100
Last post2016-03-23 22:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 5/5] cpufreq: acpi-cpufreq: Clean up hot plug notifier callback. Richard Cochran <rcochran@linutronix.de> - 2016-03-18 22:30 +0100
    Re: [PATCH 5/5] cpufreq: acpi-cpufreq: Clean up hot plug notifier callback. "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-03-23 22:30 +0100

#1360934 — [PATCH 5/5] cpufreq: acpi-cpufreq: Clean up hot plug notifier callback.

FromRichard Cochran <rcochran@linutronix.de>
Date2016-03-18 22:30 +0100
Subject[PATCH 5/5] cpufreq: acpi-cpufreq: Clean up hot plug notifier callback.
Message-ID<rea82-C9-1@gated-at.bofh.it>
This driver has two issues.  First, it tries to fiddle with the hot
plugged CPU's MSR on the UP_PREPARE event, at a time when the CPU is
not yet online.  Second, the driver sets the "boost-disable" bit for a
CPU when going down, but does not clear the bit again if the CPU comes
up again due to DOWN_FAILED.

This patch fixes the issues by changing the driver to react to the
ONLINE/DOWN_FAILED events instead of UP_PREPARE.  As an added benefit,
the driver also becomes symmetric with respect to the hot plug
mechanism.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
---
 drivers/cpufreq/acpi-cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 51eef87..7006a43 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -540,8 +540,10 @@ static int boost_notify(struct notifier_block *nb, unsigned long action,
 	 */
 
 	switch (action) {
-	case CPU_UP_PREPARE:
-	case CPU_UP_PREPARE_FROZEN:
+	case CPU_DOWN_FAILED:
+	case CPU_DOWN_FAILED_FROZEN:
+	case CPU_ONLINE:
+	case CPU_ONLINE_FROZEN:
 		boost_set_msrs(acpi_cpufreq_driver.boost_enabled, cpumask);
 		break;
 
-- 
2.1.4

[toc] | [next] | [standalone]


#1363717

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-03-23 22:30 +0100
Message-ID<rfYvM-Xc-27@gated-at.bofh.it>
In reply to#1360934
On Friday, March 18, 2016 10:26:11 PM Richard Cochran wrote:
> This driver has two issues.  First, it tries to fiddle with the hot
> plugged CPU's MSR on the UP_PREPARE event, at a time when the CPU is
> not yet online.  Second, the driver sets the "boost-disable" bit for a
> CPU when going down, but does not clear the bit again if the CPU comes
> up again due to DOWN_FAILED.
> 
> This patch fixes the issues by changing the driver to react to the
> ONLINE/DOWN_FAILED events instead of UP_PREPARE.  As an added benefit,
> the driver also becomes symmetric with respect to the hot plug
> mechanism.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Richard Cochran <rcochran@linutronix.de>
> ---
>  drivers/cpufreq/acpi-cpufreq.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 51eef87..7006a43 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -540,8 +540,10 @@ static int boost_notify(struct notifier_block *nb, unsigned long action,
>  	 */
>  
>  	switch (action) {
> -	case CPU_UP_PREPARE:
> -	case CPU_UP_PREPARE_FROZEN:
> +	case CPU_DOWN_FAILED:
> +	case CPU_DOWN_FAILED_FROZEN:
> +	case CPU_ONLINE:
> +	case CPU_ONLINE_FROZEN:
>  		boost_set_msrs(acpi_cpufreq_driver.boost_enabled, cpumask);
>  		break;

Applied, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web