linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Len Brown <lenb@kernel.org>
Cc: x86@kernel.org, linux-pm@lists.linux-foundation.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH-v2 2/8] cpuidle: add cpuidle_unregister_driver() error check
Date: Wed, 26 May 2010 22:13:01 -0700	[thread overview]
Message-ID: <20100526221301.5a85e3c5.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1005270107360.4039@localhost.localdomain>

On Thu, 27 May 2010 01:11:03 -0400 (EDT) Len Brown <lenb@kernel.org> wrote:

> From: Len Brown <len.brown@intel.com>
> 
> BUG_ON() cpuidle_unregister_driver() being called with
> a driver not matching the onee that successfully registered.
> 
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
>  drivers/cpuidle/driver.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
> index 2257004..5b6fd0f 100644
> --- a/drivers/cpuidle/driver.c
> +++ b/drivers/cpuidle/driver.c
> @@ -45,8 +45,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_driver);
>   */
>  void cpuidle_unregister_driver(struct cpuidle_driver *drv)
>  {
> -	if (!drv)
> -		return;
> +	BUG_ON(drv != cpuidle_curr_driver)
>  
>  	spin_lock(&cpuidle_driver_lock);
>  	cpuidle_curr_driver = NULL;

Actually, WARN_ON is nicer ;)   There's no point in killing the user's
machine over this recoverable error.


  reply	other threads:[~2010-05-27  5:13 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27  2:42 idle-test patches queued for upstream Len Brown
2010-05-27  2:42 ` [PATCH 1/8] cpuidle: fail to register if !CONFIG_CPU_IDLE Len Brown
2010-05-27  2:42   ` [PATCH 2/8] cpuidle: add cpuidle_unregister_driver() error check Len Brown
2010-05-27  3:14     ` Andrew Morton
2010-05-27  5:11       ` [PATCH-v2 " Len Brown
2010-05-27  5:13         ` Andrew Morton [this message]
2010-05-27  2:42   ` [PATCH 3/8] cpuidle: make cpuidle_curr_driver static Len Brown
2010-05-27  5:27     ` [PATCH-v2 " Len Brown
2010-05-27 18:40       ` Luck, Tony
2010-05-27 23:30         ` Len Brown
2010-05-27  2:42   ` [PATCH 4/8] ACPI: allow a native cpuidle driver to displace ACPI Len Brown
2010-05-27  2:42   ` [PATCH 5/8] sched: clarify commment for TS_POLLING Len Brown
2010-05-27  5:53     ` [PATCH-v2 " Len Brown
2010-05-27  2:42   ` [PATCH 6/8] acpi_pad: uses MONITOR/MWAIT, so it doesn't need to clear TS_POLLING Len Brown
2010-05-27  2:42   ` [PATCH 7/8] ACPI: acpi_idle: touch TS_POLLING only in the non-MWAIT case Len Brown
2010-05-27  2:42   ` [PATCH 8/8] intel_idle: create a native cpuidle driver for select intel processors Len Brown
2010-05-27  3:44     ` Andrew Morton
2010-05-28  3:57       ` Len Brown
2010-05-30  9:20         ` Andi Kleen
2010-05-27  8:53     ` [linux-pm] " Thomas Renninger
2010-05-28  1:44       ` Len Brown
2010-05-28  7:46         ` Thomas Renninger
2010-05-28 17:38           ` Len Brown
2010-05-29  4:17         ` Thomas Renninger
2010-05-27 14:14     ` Kevin Hilman
2010-05-27 14:22       ` Arjan van de Ven
2010-05-27 14:36         ` Kevin Hilman
2010-05-28  0:22           ` Len Brown
2010-05-28 17:28             ` Kevin Hilman
2010-05-27 14:51         ` [linux-pm] " Igor Stoppa
2010-05-28  3:14           ` Arjan van de Ven
2010-05-28 17:27             ` Kevin Hilman
2010-05-29  0:38               ` Arjan van de Ven
2010-05-28  2:32     ` Chase Douglas
2010-05-28  4:16       ` Len Brown
2010-05-28 15:09         ` Chase Douglas
2010-05-28 17:43           ` Len Brown
2010-05-28 19:51             ` Chase Douglas
2010-05-28 20:14               ` Chase Douglas
2010-05-27  5:25   ` (No subject header) Milton Miller
2010-05-27  5:47     ` Len Brown
2010-05-27  8:45 ` [linux-pm] idle-test patches queued for upstream Thomas Renninger
2010-05-28  0:59   ` Len Brown
2010-05-28  8:07     ` Thomas Renninger
2010-05-28 17:42       ` Len Brown
2010-06-16  7:53     ` Pavel Machek

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=20100526221301.5a85e3c5.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).