linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <rcochran@linutronix.de>
To: <linux-kernel@vger.kernel.org>
Cc: <rt@linutronix.de>, Len Brown <lenb@kernel.org>,
	linux-pm@vger.kernel.org
Subject: [PATCH 07/10] intel_idle: Setup the timer broadcast only on successful driver load.
Date: Tue, 29 Mar 2016 15:15:59 +0200	[thread overview]
Message-ID: <9b83c07a9a0bf153f1d82cfbea1be93d9267bbb5.1459257096.git.rcochran@linutronix.de> (raw)
In-Reply-To: <cover.1459257096.git.rcochran@linutronix.de>

This driver sets the broadcast tick quite early on during probe and does
not clean up again in cast of failure.  This patch moves the setup call
after the registration, placing the on_each_cpu() calls within the global
CPU lock region.

Cc: Len Brown <lenb@kernel.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
---
 drivers/idle/intel_idle.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 0b56872..ab34cd8 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -987,16 +987,9 @@ static int __init intel_idle_probe(void)
 	icpu = (const struct idle_cpu *)id->driver_data;
 	cpuidle_state_table = icpu->state_table;
 
-	if (boot_cpu_has(X86_FEATURE_ARAT))	/* Always Reliable APIC Timer */
-		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
-	else
-		on_each_cpu(__setup_broadcast_timer, (void *)true, 1);
-
 	pr_debug(PREFIX "v" INTEL_IDLE_VERSION
 		" model 0x%X\n", boot_cpu_data.x86_model);
 
-	pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n",
-		lapic_timer_reliable_states);
 	return 0;
 }
 
@@ -1234,8 +1227,16 @@ static int __init intel_idle_init(void)
 	}
 	__register_cpu_notifier(&cpu_hotplug_notifier);
 
+	if (boot_cpu_has(X86_FEATURE_ARAT))	/* Always Reliable APIC Timer */
+		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
+	else
+		on_each_cpu(__setup_broadcast_timer, (void *)true, 1);
+
 	cpu_notifier_register_done();
 
+	pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n",
+		lapic_timer_reliable_states);
+
 	return 0;
 }
 
-- 
2.1.4

  parent reply	other threads:[~2016-03-29 13:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 13:15 [PATCH 00/10] intel_idle: Fix hot plug handling Richard Cochran
2016-03-29 13:15 ` [PATCH 01/10] intel_idle: remove useless return from void function Richard Cochran
2016-03-29 13:15 ` [PATCH 02/10] intel_idle: Fix a helper function's return value Richard Cochran
2016-03-29 13:15 ` [PATCH 03/10] intel_idle: Remove redundant initialization calls Richard Cochran
2016-03-29 13:15 ` [PATCH 04/10] intel_idle: Fix deallocation order on the driver exit path Richard Cochran
2016-03-29 13:15 ` [PATCH 05/10] intel_idle: Fix dangling registration on error path Richard Cochran
2016-03-29 13:15 ` [PATCH 06/10] intel_idle: Avoid a double free of the per-CPU data Richard Cochran
2016-03-29 13:15 ` Richard Cochran [this message]
2016-03-29 13:16 ` [PATCH 08/10] intel_idle: Don't overreact to a cpuidle registration failure Richard Cochran
2016-03-29 13:16 ` [PATCH 09/10] intel_idle: Propagate hot plug errors Richard Cochran
2016-03-29 13:16 ` [PATCH 10/10] intel_idle: Clean up all registered devices on exit Richard Cochran
2016-04-01  1:39   ` 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=9b83c07a9a0bf153f1d82cfbea1be93d9267bbb5.1459257096.git.rcochran@linutronix.de \
    --to=rcochran@linutronix.de \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rt@linutronix.de \
    /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).