From: Joao Martins <joao.m.martins@oracle.com>
To: linux-pm@vger.kernel.org
Cc: Joao Martins <joao.m.martins@oracle.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
linux-kernel@vger.kernel.org,
Marcelo Tosatti <mtosatti@redhat.com>,
kvm@vger.kernel.org
Subject: [PATCH v1 4/4] cpuidle-haltpoll: do not set an owner to allow modunload
Date: Tue, 3 Sep 2019 12:39:13 +0100 [thread overview]
Message-ID: <20190903113913.9257-5-joao.m.martins@oracle.com> (raw)
In-Reply-To: <20190903113913.9257-1-joao.m.martins@oracle.com>
cpuidle-haltpoll can be built as a module to allow optional late load.
Given we are setting @owner to THIS_MODULE, cpuidle will attempt to grab a
module reference every time a cpuidle_device is registered -- so
essentially all online cpus get a reference.
This prevents for the module to be unloaded later, which makes the
module_exit callback entirely unused. Thus remove the @owner and allow
module to be unloaded.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
drivers/cpuidle/cpuidle-haltpoll.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
index 7a0239ef717e..49a65c6fe91e 100644
--- a/drivers/cpuidle/cpuidle-haltpoll.c
+++ b/drivers/cpuidle/cpuidle-haltpoll.c
@@ -35,7 +35,6 @@ static int default_enter_idle(struct cpuidle_device *dev,
static struct cpuidle_driver haltpoll_driver = {
.name = "haltpoll",
.governor = "haltpoll",
- .owner = THIS_MODULE,
.states = {
{ /* entry 0 is for polling */ },
{
--
2.17.1
next prev parent reply other threads:[~2019-09-03 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 11:39 [PATCH v1 0/4] cpuidle, haltpoll: governor switching on idle register Joao Martins
2019-09-03 11:39 ` [PATCH v1 1/4] cpuidle: allow governor switch on cpuidle_register_driver() Joao Martins
2019-09-03 11:39 ` [PATCH v1 2/4] cpuidle-haltpoll: set haltpoll as preferred governor Joao Martins
2019-09-03 11:39 ` [PATCH v1 3/4] cpuidle-haltpoll: return -ENODEV on modinit failure Joao Martins
2019-09-03 11:39 ` Joao Martins [this message]
2019-09-03 13:23 ` [PATCH v1 0/4] cpuidle, haltpoll: governor switching on idle register Joao Martins
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=20190903113913.9257-5-joao.m.martins@oracle.com \
--to=joao.m.martins@oracle.com \
--cc=daniel.lezcano@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=rjw@rjwysocki.net \
/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).