linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function
Date: Wed, 29 Jan 2025 17:49:10 +1100	[thread overview]
Message-ID: <Z5nPZs3FTJ15XGVI@thinks.paulus.ozlabs.org> (raw)
In-Reply-To: <D7EBXLB9JMZU.2T4WD5BP9C1GD@gmail.com>

On Wed, Jan 29, 2025 at 04:06:03PM +1000, Nicholas Piggin wrote:
> On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote:
> > This uses the 'wait' instruction to pause instruction execution when
> > idle until an interrupt occurs.
> >
> > Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> > ---
> >  arch/powerpc/platforms/microwatt/setup.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/arch/powerpc/platforms/microwatt/setup.c b/arch/powerpc/platforms/microwatt/setup.c
> > index 5e1c0997170d..97828a99780d 100644
> > --- a/arch/powerpc/platforms/microwatt/setup.c
> > +++ b/arch/powerpc/platforms/microwatt/setup.c
> > @@ -34,10 +34,19 @@ static void __init microwatt_setup_arch(void)
> >  	microwatt_rng_init();
> >  }
> >  
> > +static void microwatt_idle(void)
> > +{
> > +	if (!prep_irq_for_idle())
> > +		return;
> > +
> > +	__asm__ __volatile__ ("wait");
> > +}
> 
> Does wait cause MSR[EE] to be set? If not, do you need to use
> prep_irq_for_idle_irqsoff() here maybe?

The wait instruction doesn't do anything to MSR[EE], but a pending
external interrupt (or any asynchronous exception condition) will
terminate the wait regardless of MSR[EE].

So yes, it does like I should be using prep_irq_for_idle_irqsoff().

Thanks,
Paul.


  reply	other threads:[~2025-01-29  7:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 22:49 [PATCH 0/5] Microwatt updates Paul Mackerras
2025-01-28 22:51 ` [PATCH 1/5] powerpc/microwatt: Select COMMON_CLK in order to get the clock framework Paul Mackerras
2025-01-29  5:57   ` Nicholas Piggin
2025-01-28 22:52 ` [PATCH 2/5] powerpc/microwatt: Device-tree updates Paul Mackerras
2025-01-29  6:36   ` Nicholas Piggin
2025-01-29  7:18     ` Paul Mackerras
2025-01-29  8:20       ` Nicholas Piggin
2025-01-31 17:03         ` Segher Boessenkool
2025-01-31 16:55       ` Segher Boessenkool
2025-01-31 16:53     ` Segher Boessenkool
2025-01-31 16:48   ` Segher Boessenkool
2025-01-28 22:52 ` [PATCH 3/5] powerpc/microwatt: Define an idle power-save function Paul Mackerras
2025-01-29  6:06   ` Nicholas Piggin
2025-01-29  6:49     ` Paul Mackerras [this message]
2025-01-31 16:32     ` Segher Boessenkool
2025-02-01  1:41       ` Paul Mackerras
2025-01-31 16:25   ` Segher Boessenkool
2025-01-28 22:53 ` [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE Paul Mackerras
2025-01-29  6:14   ` Nicholas Piggin
2025-01-29  7:10     ` Paul Mackerras
2025-01-29  8:17       ` Nicholas Piggin
2025-01-31 17:30       ` Segher Boessenkool
2025-01-31 17:26   ` Segher Boessenkool
2025-01-28 22:55 ` [PATCH 5/5] powerpc/microwatt: Add SMP support Paul Mackerras
2025-01-29  6:21   ` Nicholas Piggin
2025-01-29  6:57     ` Paul Mackerras
2025-01-29  8:12       ` Nicholas Piggin
2025-01-31  1:27         ` Paul Mackerras
2025-01-29 12:50       ` Michael Ellerman
2025-01-31  1:34         ` Paul Mackerras
2025-01-31 16:13 ` [PATCH 0/5] Microwatt updates Segher Boessenkool
2025-02-01  1:22   ` Paul Mackerras
2025-03-02 10:13     ` Gabriel Paubert

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