Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1372832
| From | Len Brown <lenb@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 09/13] intel_idle: Don't overreact to a cpuidle registration failure. |
| Date | 2016-04-06 23:10 +0200 |
| Message-ID | <rl2S7-1tt-43@gated-at.bofh.it> (permalink) |
| References | <rl2S6-1tt-7@gated-at.bofh.it> |
| Organization | Intel Open Source Technology Center |
From: Richard Cochran <rcochran@linutronix.de>
The helper function, intel_idle_cpu_init, registers one new device
with the cpuidle layer. If the registration should fail, that
function immediately calls intel_idle_cpuidle_devices_uninit() to
unregister every last CPU's device. However, it makes no sense to do
so, when called from the hot plug notifier callback.
This patch moves the call to intel_idle_cpuidle_devices_uninit()
outside of the helper function to the one call site that actually
needs to perform the de-registrations.
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/idle/intel_idle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index b5e92dd..807be29 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1312,7 +1312,6 @@ static int intel_idle_cpu_init(int cpu)
if (cpuidle_register_device(dev)) {
pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu);
- intel_idle_cpuidle_devices_uninit();
return -EIO;
}
@@ -1356,6 +1355,7 @@ static int __init intel_idle_init(void)
for_each_online_cpu(i) {
retval = intel_idle_cpu_init(i);
if (retval) {
+ intel_idle_cpuidle_devices_uninit();
cpu_notifier_register_done();
cpuidle_unregister_driver(&intel_idle_driver);
free_percpu(intel_idle_cpuidle_devices);
--
2.8.0.rc4.16.g56331f8
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 0/13] intel_idle patches ready for upstream Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 13/13] intel_idle: Add KBL support Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 08/13] intel_idle: Setup the timer broadcast only on successful driver load. Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 07/13] intel_idle: Avoid a double free of the per-CPU data. Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 02/13] intel_idle: remove useless return from void function. Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 04/13] intel_idle: Remove redundant initialization calls. Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 06/13] intel_idle: Fix dangling registration on error path. Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 01/13] intel_idle: add BXT support Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200 [PATCH 09/13] intel_idle: Don't overreact to a cpuidle registration failure. Len Brown <lenb@kernel.org> - 2016-04-06 23:10 +0200
csiph-web