linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH 4/4] cpuidle/powernv: avoid double irq enable coming out of idle
Date: Fri, 17 Nov 2017 02:00:52 +1000	[thread overview]
Message-ID: <20171116160052.18672-5-npiggin@gmail.com> (raw)
In-Reply-To: <20171116160052.18672-1-npiggin@gmail.com>

Since e1689795a7 ("cpuidle: Add common time keeping and irq enabling"),
cpuidle drivers are expected to return from ->enter with irqs disabled.

Update the cpuidle-powernv snooze and cede loops to disable irqs before
returning.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 drivers/cpuidle/cpuidle-pseries.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
index a187a39fb866..0f2b697cbb27 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -51,8 +51,6 @@ static inline void idle_loop_epilog(unsigned long in_purr)
 	get_lppaca()->wait_state_cycles = cpu_to_be64(wait_cycles);
 	get_lppaca()->idle = 0;
 
-	if (irqs_disabled())
-		local_irq_enable();
 	ppc64_runlatch_on();
 }
 
@@ -87,6 +85,8 @@ static int snooze_loop(struct cpuidle_device *dev,
 	HMT_medium();
 	clear_thread_flag(TIF_POLLING_NRFLAG);
 
+	local_irq_disable();
+
 	idle_loop_epilog(in_purr);
 
 	return index;
@@ -121,6 +121,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
 	HMT_medium();
 	check_and_cede_processor();
 
+	local_irq_disable();
 	get_lppaca()->donate_dedicated_cpu = 0;
 
 	idle_loop_epilog(in_purr);
@@ -145,6 +146,7 @@ static int shared_cede_loop(struct cpuidle_device *dev,
 	 */
 	check_and_cede_processor();
 
+	local_irq_disable();
 	idle_loop_epilog(in_purr);
 
 	return index;
-- 
2.15.0

  parent reply	other threads:[~2017-11-16 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 16:00 [PATCH 0/4] interrupt tracing fixes Nicholas Piggin
2017-11-16 16:00 ` [PATCH 1/4] powerpc: define __ARCH_IRQ_EXIT_IRQS_DISABLED Nicholas Piggin
2018-01-22  3:34   ` [1/4] " Michael Ellerman
2017-11-16 16:00 ` [PATCH 2/4] powerpc/64: do not trace irqs-off at interrupt return to soft-disabled context Nicholas Piggin
2017-12-04  5:09   ` Michael Ellerman
2017-12-04  6:07     ` Nicholas Piggin
2017-12-04 12:55       ` Michael Ellerman
2017-12-04 16:12     ` Benjamin Herrenschmidt
2017-12-05  5:52       ` Michael Ellerman
2017-12-12 11:39   ` [2/4] " Michael Ellerman
2017-11-16 16:00 ` [PATCH 3/4] cpuidle/powernv: avoid double irq enable coming out of idle Nicholas Piggin
2018-01-22  3:34   ` [3/4] " Michael Ellerman
2017-11-16 16:00 ` Nicholas Piggin [this message]
2018-01-22  3:34   ` [4/4] " Michael Ellerman

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=20171116160052.18672-5-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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).