From: Dongsheng Wang <dongsheng.wang@freescale.com>
To: <daniel.lezcano@linaro.org>
Cc: rjw@sisk.pl, linuxppc-dev@lists.ozlabs.org,
Wang Dongsheng <dongsheng.wang@freescale.com>,
linux-pm@vger.kernel.org
Subject: [PATCH 1/2] cpuidle: fix cpu idle driver as a module can not remove
Date: Tue, 23 Jul 2013 17:28:00 +0800 [thread overview]
Message-ID: <1374571681-31911-1-git-send-email-dongsheng.wang@freescale.com> (raw)
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
next reply other threads:[~2013-07-23 10:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 9:28 Dongsheng Wang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374571681-31911-1-git-send-email-dongsheng.wang@freescale.com \
--to=dongsheng.wang@freescale.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).