lkml.org 
[lkml]   [2017]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] ARM: cpuidle: replace cpuidle_get_driver with cpuidle_get_cpu_driver
Date
commit d50a7d8acd78 ("ARM: cpuidle: Support asymmetric idle definition")
supports multiple CPU idle driver so every CPU has its own driver. When
the initialization fails, the failure handling releases the resources
for every previous CPU; so it needs to retrieve every CPU device and
driver handler and unregister them. But the function
cpuidle_get_driver() can only return current CPU driver handler but not
the iterated CPU driver handler, so it cannot release resource properly.

This patch is to replace cpuidle_get_driver() with
cpuidle_get_cpu_driver(), every CPU has its own device handler so this
function can get back correct driver handler for the CPU according to
the CPU device handler. By using this CPU driver handler we can release
resource properly.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Fixes: d50a7d8acd78 ("ARM: cpuidle: Support asymmetric idle definition")
---
drivers/cpuidle/cpuidle-arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
index f419f6a..ef34780 100644
--- a/drivers/cpuidle/cpuidle-arm.c
+++ b/drivers/cpuidle/cpuidle-arm.c
@@ -161,9 +161,9 @@ static int __init arm_idle_init(void)

while (--cpu >= 0) {
dev = per_cpu(cpuidle_devices, cpu);
+ drv = cpuidle_get_cpu_driver(dev);
cpuidle_unregister_device(dev);
kfree(dev);
- drv = cpuidle_get_driver();
cpuidle_unregister_driver(drv);
kfree(drv);
}
--
2.7.4
\
 
 \ /
  Last update: 2017-09-04 08:53    [W:0.075 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site