From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: rjw@rjwysocki.net, daniel.lezcano@linaro.org,
linux-pm@vger.kernel.org, mtosatti@redhat.com,
Zhenzhong Duan <zhenzhong.duan@oracle.com>,
Joao Martins <joao.m.martins@oracle.com>
Subject: [PATCH v2] cpuidle-haltpoll: make haltpoll aware of 'idle=' override
Date: Fri, 18 Oct 2019 08:49:29 +0800 [thread overview]
Message-ID: <1571359769-32040-1-git-send-email-zhenzhong.duan@oracle.com> (raw)
Currenly haltpoll isn't aware of the 'idle=' override, the priority is
'idle=poll' > haltpoll > 'idle=halt'. When 'idle=poll' is used, cpuidle
driver is bypassed but current_driver in sys still shows 'haltpoll'.
When 'idle=halt' is used, haltpoll take precedence and make 'idle=halt'
no effect.
Add a check to not load haltpoll driver if there is 'idle='.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
v2: remove #if guard per Rafael
drivers/cpuidle/cpuidle-haltpoll.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
index 932390b..b0ce9bc 100644
--- a/drivers/cpuidle/cpuidle-haltpoll.c
+++ b/drivers/cpuidle/cpuidle-haltpoll.c
@@ -95,6 +95,10 @@ static int __init haltpoll_init(void)
int ret;
struct cpuidle_driver *drv = &haltpoll_driver;
+ /* Do not load haltpoll if idle= is passed */
+ if (boot_option_idle_override != IDLE_NO_OVERRIDE)
+ return -ENODEV;
+
cpuidle_poll_state_init(drv);
if (!kvm_para_available() ||
--
1.8.3.1
reply other threads:[~2019-10-18 0:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1571359769-32040-1-git-send-email-zhenzhong.duan@oracle.com \
--to=zhenzhong.duan@oracle.com \
--cc=daniel.lezcano@linaro.org \
--cc=joao.m.martins@oracle.com \
--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).