Patchwork [3/3] sparc32,leon: don't rely on bootloader to mask IRQs

login
register
mail settings
Submitter Daniel Hellstrom
Date April 21, 2011, 2:20 p.m.
Message ID <1303395625-6911-3-git-send-email-daniel@gaisler.com>
Download mbox | patch
Permalink /patch/92419/
State Accepted
Delegated to: David Miller
Headers show

Comments

Daniel Hellstrom - April 21, 2011, 2:20 p.m.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
---
 arch/sparc/kernel/leon_kernel.c |    3 +++
 arch/sparc/kernel/leon_smp.c    |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)
Sam Ravnborg - April 23, 2011, 11:08 a.m.
On Thu, Apr 21, 2011 at 04:20:25PM +0200, Daniel Hellstrom wrote:
> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>

Looks OK.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c
index 8417a91..2f538ac 100644
--- a/arch/sparc/kernel/leon_kernel.c
+++ b/arch/sparc/kernel/leon_kernel.c
@@ -345,6 +345,9 @@  void __init leon_init_timers(irq_handler_t counter_fn)
 	icsel = (icsel >> ((7 - (boot_cpu_id&0x7)) * 4)) & 0xf;
 	leon3_irqctrl_regs += icsel;
 
+	/* Mask all IRQs on boot-cpu IRQ controller */
+	LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->mask[boot_cpu_id], 0);
+
 	/* Probe extended IRQ controller */
 	eirq = (LEON3_BYPASS_LOAD_PA(&leon3_irqctrl_regs->mpstatus)
 		>> 16) & 0xf;
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 496b95f..826a505 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -219,6 +219,10 @@  int __cpuinit leon_boot_one_cpu(int i)
 	       (unsigned int)&leon3_irqctrl_regs->mpstatus);
 	local_flush_cache_all();
 
+	/* Make sure all IRQs are of from the start for this new CPU */
+	LEON_BYPASS_STORE_PA(&leon3_irqctrl_regs->mask[i], 0);
+
+	/* Wake one CPU */
 	LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpstatus), 1 << i);
 
 	/* wheee... it's going... */