All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck
@ 2013-06-10  6:56 Andreas Larsson
  2013-06-17  6:13 ` Andreas Larsson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Larsson @ 2013-06-10  6:56 UTC (permalink / raw)
  To: sparclinux

This enables interrupts for Leon before having the CPU enter power-down mode.

Commit 87fa05aeb3a5e8e21b1a5510eef6983650eff092, "sparc: Use generic idle loop",
gets the CPU stuck on idle for Leon systems. On Leon, disabling interrupts and
powering down the processor will get the processor stuck waiting for an
interrupt that will never be reacted to.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
---

I assume that going idle with interrupts disabled is the right thing to
do for the other users of the sparc_idle function pointer. Otherwise,
the right way to go is probably to enable interrupts in the 32-bit
arch_cpu_idle before calling the idle function instead.

 arch/sparc/kernel/leon_pmc.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/sparc/kernel/leon_pmc.c b/arch/sparc/kernel/leon_pmc.c
index bdf53d9..b0b3967 100644
--- a/arch/sparc/kernel/leon_pmc.c
+++ b/arch/sparc/kernel/leon_pmc.c
@@ -47,6 +47,10 @@ void pmc_leon_idle_fixup(void)
 	 * MMU does not get a TLB miss here by using the MMU BYPASS ASI.
 	 */
 	register unsigned int address = (unsigned int)leon3_irqctrl_regs;
+
+	/* Interrupts need to be enabled to not hang the CPU */
+	local_irq_enable();
+
 	__asm__ __volatile__ (
 		"wr	%%g0, %%asr19\n"
 		"lda	[%0] %1, %%g0\n"
@@ -60,6 +64,9 @@ void pmc_leon_idle_fixup(void)
  */
 void pmc_leon_idle(void)
 {
+	/* Interrupts need to be enabled to not hang the CPU */
+	local_irq_enable();
+
 	/* For systems without power-down, this will be no-op */
 	__asm__ __volatile__ ("wr	%g0, %asr19\n\t");
 }
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck
  2013-06-10  6:56 [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck Andreas Larsson
@ 2013-06-17  6:13 ` Andreas Larsson
  2013-06-17  6:53 ` David Miller
  2013-06-19  9:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Larsson @ 2013-06-17  6:13 UTC (permalink / raw)
  To: sparclinux

On 2013-06-10 08:56, Andreas Larsson wrote:
> This enables interrupts for Leon before having the CPU enter power-down mode.
>
> Commit 87fa05aeb3a5e8e21b1a5510eef6983650eff092, "sparc: Use generic idle loop",
> gets the CPU stuck on idle for Leon systems. On Leon, disabling interrupts and
> powering down the processor will get the processor stuck waiting for an
> interrupt that will never be reacted to.

Anything stopping this from going into v3.10-rc7? The issue is critical. 
Commit 87fa05aeb3a5e8e21b1a5510eef6983650eff092 outright breaks the 
kernel for Leon systems.

Best Regards,
Andreas Larsson


>
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
> ---
>
> I assume that going idle with interrupts disabled is the right thing to
> do for the other users of the sparc_idle function pointer. Otherwise,
> the right way to go is probably to enable interrupts in the 32-bit
> arch_cpu_idle before calling the idle function instead.
>
>   arch/sparc/kernel/leon_pmc.c |    7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/arch/sparc/kernel/leon_pmc.c b/arch/sparc/kernel/leon_pmc.c
> index bdf53d9..b0b3967 100644
> --- a/arch/sparc/kernel/leon_pmc.c
> +++ b/arch/sparc/kernel/leon_pmc.c
> @@ -47,6 +47,10 @@ void pmc_leon_idle_fixup(void)
>   	 * MMU does not get a TLB miss here by using the MMU BYPASS ASI.
>   	 */
>   	register unsigned int address = (unsigned int)leon3_irqctrl_regs;
> +
> +	/* Interrupts need to be enabled to not hang the CPU */
> +	local_irq_enable();
> +
>   	__asm__ __volatile__ (
>   		"wr	%%g0, %%asr19\n"
>   		"lda	[%0] %1, %%g0\n"
> @@ -60,6 +64,9 @@ void pmc_leon_idle_fixup(void)
>    */
>   void pmc_leon_idle(void)
>   {
> +	/* Interrupts need to be enabled to not hang the CPU */
> +	local_irq_enable();
> +
>   	/* For systems without power-down, this will be no-op */
>   	__asm__ __volatile__ ("wr	%g0, %asr19\n\t");
>   }
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck
  2013-06-10  6:56 [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck Andreas Larsson
  2013-06-17  6:13 ` Andreas Larsson
@ 2013-06-17  6:53 ` David Miller
  2013-06-19  9:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-17  6:53 UTC (permalink / raw)
  To: sparclinux

From: Andreas Larsson <andreas@gaisler.com>
Date: Mon, 17 Jun 2013 08:13:41 +0200

> On 2013-06-10 08:56, Andreas Larsson wrote:
>> This enables interrupts for Leon before having the CPU enter
>> power-down mode.
>>
>> Commit 87fa05aeb3a5e8e21b1a5510eef6983650eff092, "sparc: Use generic
>> idle loop",
>> gets the CPU stuck on idle for Leon systems. On Leon, disabling
>> interrupts and
>> powering down the processor will get the processor stuck waiting for
>> an
>> interrupt that will never be reacted to.
> 
> Anything stopping this from going into v3.10-rc7? The issue is
> critical. Commit 87fa05aeb3a5e8e21b1a5510eef6983650eff092 outright
> breaks the kernel for Leon systems.

I'm just backlogged, I'll take care of this tomorrow.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck
  2013-06-10  6:56 [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck Andreas Larsson
  2013-06-17  6:13 ` Andreas Larsson
  2013-06-17  6:53 ` David Miller
@ 2013-06-19  9:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-19  9:14 UTC (permalink / raw)
  To: sparclinux

From: Andreas Larsson <andreas@gaisler.com>
Date: Mon, 10 Jun 2013 08:56:41 +0200

> This enables interrupts for Leon before having the CPU enter power-down mode.
> 
> Commit 87fa05aeb3a5e8e21b1a5510eef6983650eff092, "sparc: Use generic idle loop",
> gets the CPU stuck on idle for Leon systems. On Leon, disabling interrupts and
> powering down the processor will get the processor stuck waiting for an
> interrupt that will never be reacted to.
> 
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-19  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10  6:56 [PATCH] sparc32, leon: Enable interrupts before going idle to avoid getting stuck Andreas Larsson
2013-06-17  6:13 ` Andreas Larsson
2013-06-17  6:53 ` David Miller
2013-06-19  9:14 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.