Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1366275 > unrolled thread

[PATCH 10/10] intel_idle: Clean up all registered devices on exit.

Started byRichard Cochran <rcochran@linutronix.de>
First post2016-03-29 15:20 +0200
Last post2016-04-01 03:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 10/10] intel_idle: Clean up all registered devices on exit. Richard Cochran <rcochran@linutronix.de> - 2016-03-29 15:20 +0200
    Re: [PATCH 10/10] intel_idle: Clean up all registered devices on exit. Len Brown <lenb@kernel.org> - 2016-04-01 03:40 +0200

#1366275 — [PATCH 10/10] intel_idle: Clean up all registered devices on exit.

FromRichard Cochran <rcochran@linutronix.de>
Date2016-03-29 15:20 +0200
Subject[PATCH 10/10] intel_idle: Clean up all registered devices on exit.
Message-ID<ri1IU-6LW-49@gated-at.bofh.it>
This driver registers cpuidle devices when a CPU comes online, but it
leaves the registrations in place when a CPU goes offline.  The module
exit code only unregisters the currently online CPUs, leaving the
devices for offline CPUs dangling.

This patch changes the driver to clean up all registrations on exit,
even those from CPUs that are offline.

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 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 8420ba1..862346b 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1245,12 +1245,19 @@ static int __init intel_idle_init(void)
 
 static void __exit intel_idle_exit(void)
 {
+	struct cpuidle_device *dev;
+	int i;
+
 	cpu_notifier_register_begin();
 
 	if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE)
 		on_each_cpu(__setup_broadcast_timer, (void *)false, 1);
 	__unregister_cpu_notifier(&cpu_hotplug_notifier);
-	intel_idle_cpuidle_devices_uninit();
+
+	for_each_possible_cpu(i) {
+		dev = per_cpu_ptr(intel_idle_cpuidle_devices, i);
+		cpuidle_unregister_device(dev);
+	}
 
 	cpu_notifier_register_done();
 
-- 
2.1.4

[toc] | [next] | [standalone]


#1368929

FromLen Brown <lenb@kernel.org>
Date2016-04-01 03:40 +0200
Message-ID<riWe5-5kF-1@gated-at.bofh.it>
In reply to#1366275
1-10 Applied.

Thanks Richard!

Len Brown, Intel Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web