linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: lenb@kernel.org, linux-acpi@vger.kernel.org
Cc: deepthi@linux.vnet.ibm.com, Thomas Renninger <trenn@suse.de>
Subject: [PATCH 1/3] Revert "intel_idle: disable auto_demotion for hotplugged CPUs"
Date: Tue, 17 Jan 2012 17:20:28 +0100	[thread overview]
Message-ID: <1326817230-79711-2-git-send-email-trenn@suse.de> (raw)
In-Reply-To: <1326817230-79711-1-git-send-email-trenn@suse.de>

This reverts commit e5f03b06dc99348df53118c6ef7b51a8611a7256.

Signed-off-by: Thomas Renninger <trenn@suse.de>
---
 drivers/idle/intel_idle.c |   53 +++++++++++++++++----------------------------
 1 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index e56ae0b..91aff18 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -296,42 +296,33 @@ static void __setup_broadcast_timer(void *arg)
 	clockevents_notify(reason, &cpu);
 }
 
-static void auto_demotion_disable(void *dummy)
-{
-	unsigned long long msr_bits;
-
-	rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
-	msr_bits &= ~auto_demotion_disable_flags;
-	wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
-}
-
-static void __intel_idle_notify_handler(void *arg)
-{
-	if (auto_demotion_disable_flags)
-		auto_demotion_disable(NULL);
-
-	if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE)
-		__setup_broadcast_timer((void *)true);
-}
-
-static int setup_intelidle_cpuhp_notify(struct notifier_block *n,
+static int setup_broadcast_cpuhp_notify(struct notifier_block *n,
 		unsigned long action, void *hcpu)
 {
 	int hotcpu = (unsigned long)hcpu;
 
 	switch (action & 0xf) {
 	case CPU_ONLINE:
-		smp_call_function_single(hotcpu, __intel_idle_notify_handler,
-			NULL, 1);
+		smp_call_function_single(hotcpu, __setup_broadcast_timer,
+			(void *)true, 1);
 		break;
 	}
 	return NOTIFY_OK;
 }
 
-static struct notifier_block setup_intelidle_notifier = {
-	.notifier_call = setup_intelidle_cpuhp_notify,
+static struct notifier_block setup_broadcast_notifier = {
+	.notifier_call = setup_broadcast_cpuhp_notify,
 };
 
+static void auto_demotion_disable(void *dummy)
+{
+	unsigned long long msr_bits;
+
+	rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
+	msr_bits &= ~auto_demotion_disable_flags;
+	wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits);
+}
+
 /*
  * intel_idle_probe()
  */
@@ -402,8 +393,10 @@ static int intel_idle_probe(void)
 
 	if (boot_cpu_has(X86_FEATURE_ARAT))	/* Always Reliable APIC Timer */
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
-	else
+	else {
 		on_each_cpu(__setup_broadcast_timer, (void *)true, 1);
+		register_cpu_notifier(&setup_broadcast_notifier);
+	}
 
 	pr_debug(PREFIX "v" INTEL_IDLE_VERSION
 		" model 0x%X\n", boot_cpu_data.x86_model);
@@ -566,10 +559,6 @@ static int __init intel_idle_init(void)
 		return retval;
 	}
 
-	if (auto_demotion_disable_flags || lapic_timer_reliable_states !=
-	    LAPIC_TIMER_ALWAYS_RELIABLE)
-		register_cpu_notifier(&setup_intelidle_notifier);
-
 	return 0;
 }
 
@@ -578,12 +567,10 @@ static void __exit intel_idle_exit(void)
 	intel_idle_cpuidle_devices_uninit();
 	cpuidle_unregister_driver(&intel_idle_driver);
 
-	if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE)
+	if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE) {
 		on_each_cpu(__setup_broadcast_timer, (void *)false, 1);
-
-	if (auto_demotion_disable_flags || lapic_timer_reliable_states !=
-	    LAPIC_TIMER_ALWAYS_RELIABLE)
-		unregister_cpu_notifier(&setup_intelidle_notifier);
+		unregister_cpu_notifier(&setup_broadcast_notifier);
+	}
 
 	return;
 }
-- 
1.7.6.1


  reply	other threads:[~2012-01-17 16:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 16:20 [RESEND] X86 cpuidle cleanups Thomas Renninger
2012-01-17 16:20 ` Thomas Renninger [this message]
2012-01-17 16:20 ` [PATCH 2/3] ACPI processor: Remove unneeded variable passed by acpi_processor_hotadd_init Thomas Renninger
2012-01-17 16:22   ` Thomas Renninger
2012-01-17 16:29   ` Konrad Rzeszutek Wilk
2012-01-17 16:47     ` Thomas Renninger
2012-01-17 16:52       ` Konrad Rzeszutek Wilk
2012-01-17 16:20 ` [PATCH 3/3] intel_idle: Split up and provide per CPU initialization func Thomas Renninger
  -- strict thread matches above, loose matches on Subject: below --
2012-01-17 16:31 [Resend] X86 cpuidle cleanups V2 Thomas Renninger
2012-01-17 16:31 ` [PATCH 1/3] Revert "intel_idle: disable auto_demotion for hotplugged CPUs" Thomas Renninger

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=1326817230-79711-2-git-send-email-trenn@suse.de \
    --to=trenn@suse.de \
    --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 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).