linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cpuidle: fix cpu idle driver as a module can not remove
@ 2013-07-23  9:28 Dongsheng Wang
  2013-07-23  9:28 ` [PATCH 2/2] cpuidle: export cpuidle_idle_call symbol Dongsheng Wang
  2013-07-23 21:32 ` [PATCH 1/2] cpuidle: fix cpu idle driver as a module can not remove Rafael J. Wysocki
  0 siblings, 2 replies; 7+ messages in thread
From: Dongsheng Wang @ 2013-07-23  9:28 UTC (permalink / raw)
  To: daniel.lezcano; +Cc: rjw, linuxppc-dev, Wang Dongsheng, linux-pm

From: Wang Dongsheng <dongsheng.wang@freescale.com>

The module can not be removed when execute "rmmod". rmmod not use
"--force".

Log:
root:~# rmmod cpuidle-e500
incs[9], decs[1]
rmmod: can't unload 'cpuidle_e500': Resource temporarily unavailable

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
---
Branch: pm-cpuidle

 drivers/cpuidle/cpuidle.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index fdc432f..534320a 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -386,6 +386,9 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
 		goto err_coupled;
 
 	dev->registered = 1;
+
+	module_put(drv->owner);
+
 	return 0;
 
 err_coupled:
@@ -432,8 +435,6 @@ EXPORT_SYMBOL_GPL(cpuidle_register_device);
  */
 void cpuidle_unregister_device(struct cpuidle_device *dev)
 {
-	struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
-
 	if (dev->registered == 0)
 		return;
 
@@ -448,8 +449,6 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)
 	cpuidle_coupled_unregister_device(dev);
 
 	cpuidle_resume_and_unlock();
-
-	module_put(drv->owner);
 }
 
 EXPORT_SYMBOL_GPL(cpuidle_unregister_device);
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-24 10:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23  9:28 [PATCH 1/2] cpuidle: fix cpu idle driver as a module can not remove Dongsheng Wang
2013-07-23  9:28 ` [PATCH 2/2] cpuidle: export cpuidle_idle_call symbol Dongsheng Wang
2013-07-23 21:33   ` Rafael J. Wysocki
2013-07-24  2:17     ` Wang Dongsheng-B40534
2013-07-23 21:32 ` [PATCH 1/2] cpuidle: fix cpu idle driver as a module can not remove Rafael J. Wysocki
2013-07-24  2:26   ` Wang Dongsheng-B40534
2013-07-24 10:33     ` Li Yang-R58472

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).