All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	deepthi@linux.vnet.ibm.com
Subject: Re: [PATCH 2/5] ACPI processor: Avoid WARN message on processor driver removal
Date: Tue, 17 Jan 2012 15:58:49 +0100	[thread overview]
Message-ID: <201201171558.49411.trenn@suse.de> (raw)
In-Reply-To: <4F15554F.8040900@kernel.org>

On Tuesday, January 17, 2012 12:02:39 PM Len Brown wrote:
> On 11/17/2011 05:36 PM, Thomas Renninger wrote:
> 
> > Only unregister acpi_idle driver if acpi_idle driver got
> > registered.
> > 
> > Also add a static acpi_idle_active variable for easy and nicer
> > checking whether acpi_idle_driver is active (as suggested by
> > Bjorn).
> > 
> > Signed-off-by: Thomas Renninger <trenn@suse.de>
> > CC: Len Brown <lenb@kernel.org>
> > CC: linux-acpi@vger.kernel.org
> > CC: Bjorn Helgaas <bhelgaas@google.com>
> > ---
> >  drivers/acpi/processor_driver.c |   11 +++++++----
> >  1 files changed, 7 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> > index 3a4fc0c..790623f 100644
> > --- a/drivers/acpi/processor_driver.c
> > +++ b/drivers/acpi/processor_driver.c
> > @@ -110,6 +110,7 @@ static struct cpuidle_driver acpi_idle_driver = {
> >  	.name =		"acpi_idle",
> >  	.owner =	THIS_MODULE,
> >  };
> > +static int acpi_idle_active;
> >  
> >  #define INSTALL_NOTIFY_HANDLER		1
> >  #define UNINSTALL_NOTIFY_HANDLER	2
> > @@ -508,8 +509,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
> >  	acpi_processor_get_throttling_info(pr);
> >  	acpi_processor_get_limit_info(pr);
> >  
> > -
> > -	if (cpuidle_get_driver() == &acpi_idle_driver)
> > +	if (acpi_idle_active)
> >  		acpi_processor_power_init(pr, device);
> 
> 
> I think the old cold reads better than the new code,
> since I don't have to guess what "acpi_idle_active" means...
> 
> Perhaps you can use the existing mechanism where
> it is missing to guard the unregister and re-fresh?
With commit 46bcfad7a819bd17ac4e831b04405152d59784ab
Author: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Date:   Fri Oct 28 16:20:42 2011 +0530

    cpuidle: Single/Global registration of idle states

the offending unregistering line is not needed anymore at all
and a new patch would look similar to:
@@ -846,7 +848,8 @@ static void __exit acpi_processor_exit(void)
 
        acpi_bus_unregister_driver(&acpi_processor_driver);
 
-       cpuidle_unregister_driver(&acpi_idle_driver);
 
        return;
 }

I'll send something with Deepthi in CC to double check.

   Thomas

  parent reply	other threads:[~2012-01-17 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1321569421-46220-1-git-send-email-trenn@suse.de>
2011-11-17 22:36 ` [PATCH 1/5] ACPI processor: Do not export acpi_idle_driver in processor.h Thomas Renninger
2012-01-17 11:25   ` Len Brown
2012-01-17 14:08     ` Thomas Renninger
2011-11-17 22:36 ` [PATCH 2/5] ACPI processor: Avoid WARN message on processor driver removal Thomas Renninger
2012-01-17 11:02   ` Len Brown
2012-01-17 14:25     ` Thomas Renninger
2012-01-17 14:41       ` Bjorn Helgaas
2012-01-17 14:58     ` Thomas Renninger [this message]
2011-11-17 22:36 ` [PATCH 3/5] intel_idle: Split up and provide per CPU initialization func Thomas Renninger
2011-11-17 22:44   ` Thomas Renninger
2012-01-17 11:06   ` Len Brown
2012-01-17 13:26     ` Thomas Renninger
2012-01-17 16:10       ` Thomas Renninger
2011-11-17 22:37 ` [PATCH 4/5] ACPI processor: Fix error path, also remove sysdev link Thomas Renninger
2011-11-17 22:37 ` [PATCH 5/5] ACPI processor: Remove unneeded variable passed by acpi_processor_hotadd_init Thomas Renninger
2012-01-17 11:10   ` Len Brown

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=201201171558.49411.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=bhelgaas@google.com \
    --cc=deepthi@linux.vnet.ibm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.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 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.