[PATCH 09/16] intel_idle: Propagate hot plug errors.

Tim Gardner tim.gardner at canonical.com
Wed Aug 24 21:29:39 UTC 2016

From: Richard Cochran <rcochran at linutronix.de>

BugLink: http://bugs.launchpad.net/bugs/1591821

If a cpuidle registration error occurs during the hot plug notifier
callback, we should really inform the hot plug machinery instead of
just ignoring the error.  This patch changes the callback to properly
return on error.

Signed-off-by: Richard Cochran <rcochran at linutronix.de>
Signed-off-by: Len Brown <len.brown at intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
(cherry picked from commit 08820546e4c30c84d0a1f1a49df055e1719c07ea)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
 drivers/idle/intel_idle.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 4418cfa..8420ba1 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -818,8 +818,11 @@ static int cpu_hotplug_notify(struct notifier_block *n,
 		 * driver in this case
 		dev = per_cpu_ptr(intel_idle_cpuidle_devices, hotcpu);
-		if (!dev->registered)
-			intel_idle_cpu_init(hotcpu);
+		if (dev->registered)
+			break;
+		if (intel_idle_cpu_init(hotcpu))
+			return NOTIFY_BAD;

More information about the kernel-team mailing list