Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-31 Thread Paul Mackerras
On Fri, Jan 31, 2025 at 10:32:55AM -0600, Segher Boessenkool wrote: > On Wed, Jan 29, 2025 at 04:06:03PM +1000, Nicholas Piggin wrote: > > Does wait cause MSR[EE] to be set? If not, do you need to use > > prep_irq_for_idle_irqsoff() here maybe? > > Assuming this does implement the standard ISA 2.0

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-31 Thread Segher Boessenkool
On Wed, Jan 29, 2025 at 04:06:03PM +1000, Nicholas Piggin wrote: > Does wait cause MSR[EE] to be set? If not, do you need to use > prep_irq_for_idle_irqsoff() here maybe? Assuming this does implement the standard ISA 2.03 wait instruction (and it better), this does not do anything other than to st

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-31 Thread Segher Boessenkool
Hi! > +static void microwatt_idle(void) > +{ > + if (!prep_irq_for_idle()) > + return; > + > + __asm__ __volatile__ ("wait"); > +} All asm without outputs is always implicitly volatile (if it wasn't, it could always be transfirmed whatever way you want, like, optimised away co

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Paul Mackerras
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 > > --- > > arch/powerpc

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Nicholas Piggin
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 > --- > arch/powerpc/platforms/microwatt/setup.c | 9 + > 1 file changed, 9 insertions(+) >

[PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Paul Mackerras
This uses the 'wait' instruction to pause instruction execution when idle until an interrupt occurs. Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/microwatt/setup.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/platforms/microwatt/setup.c b/arch/powerpc/pl