Linux Power Management development
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: bigeasy@linutronix.de, rjw@rjwysocki.net,
	viresh.kumar@linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 2/2] cpufreq: Remove cpu hotplug callbacks only if they were initialized
Date: Thu, 15 Dec 2016 17:47:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1612151747480.3470@nanos> (raw)
In-Reply-To: <1481814058-4799-3-git-send-email-boris.ostrovsky@oracle.com>

On Thu, 15 Dec 2016, Boris Ostrovsky wrote:

> Since cpu hotplug callbacks are requested for CPUHP_AP_ONLINE_DYN state,
> successful callback initialization will result in cpuhp_setup_state()
> returning a positive value. Therefore acpi_cpufreq_online being zero
> indicates that callbacks have not been installed.
> 
> This means that acpi_cpufreq_boost_exit() should only remove them if
> acpi_cpufreq_online is positive. Trying to call
> cpuhp_remove_state_nocalls(0) will cause a BUG().
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  drivers/cpufreq/acpi-cpufreq.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 3a98702..3a2ca0f 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -930,7 +930,7 @@ static void __init acpi_cpufreq_boost_init(void)
>  
>  static void acpi_cpufreq_boost_exit(void)
>  {
> -	if (acpi_cpufreq_online >= 0)
> +	if (acpi_cpufreq_online > 0)
>  		cpuhp_remove_state_nocalls(acpi_cpufreq_online);
>  }
>  
> -- 
> 1.7.1
> 
> 

      reply	other threads:[~2016-12-15 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 15:00 [PATCH 0/2] __cpuhp_setup_state() returns positive value for dynamic state Boris Ostrovsky
2016-12-15 15:00 ` [PATCH 1/2] cpu/hotplug: Clarify description of __cpuhp_setup_state() return value Boris Ostrovsky
2016-12-15 15:00 ` [PATCH 2/2] cpufreq: Remove cpu hotplug callbacks only if they were initialized Boris Ostrovsky
2016-12-15 16:47   ` Thomas Gleixner [this message]

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=alpine.DEB.2.20.1612151747480.3470@nanos \
    --to=tglx@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=boris.ostrovsky@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@linaro.org \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox