@@ -18,10 +18,8 @@ struct seq_file;
* This is internal. Do not use it.
*/
#ifdef CONFIG_FIQ
-extern void init_FIQ(void);
extern void show_fiq_list(struct seq_file *, int);
#else
-static inline void init_FIQ(void) {}
static inline void show_fiq_list(struct seq_file *p, int prec) {}
#endif
@@ -49,6 +49,7 @@
#include <asm/mach/irq.h>
static unsigned long no_fiq_insn;
+static int got_no_fiq_insn;
/* Default reacquire function
* - we always relinquish FIQ control
@@ -78,11 +79,14 @@ void show_fiq_list(struct seq_file *p, int prec)
void set_fiq_handler(void *start, unsigned int length)
{
-#if defined(CONFIG_CPU_USE_DOMAINS)
- memcpy((void *)0xffff001c, start, length);
-#else
- memcpy(vectors_page + 0x1c, start, length);
+ unsigned long *addr = (void *)0xffff001c;
+
+#ifndef CONFIG_CPU_USE_DOMAINS
+ addr = vectors_page + 0x1c;
#endif
+ if (!cmpxchg(&got_no_fiq_insn, 0, 1))
+ no_fiq_insn = *addr;
+ memcpy(addr, start, length);
flush_icache_range(0xffff001c, 0xffff001c + length);
if (!vectors_high())
flush_icache_range(0x1c, 0x1c + length);
@@ -126,8 +130,3 @@ EXPORT_SYMBOL(__set_fiq_regs); /* defined in fiqasm.S */
EXPORT_SYMBOL(__get_fiq_regs); /* defined in fiqasm.S */
EXPORT_SYMBOL(claim_fiq);
EXPORT_SYMBOL(release_fiq);
-
-void __init init_FIQ(void)
-{
- no_fiq_insn = *(unsigned long *)0xffff001c;
-}
@@ -151,7 +151,5 @@ void __init rpc_init_irq(void)
break;
}
}
-
- init_FIQ();
}
@@ -216,8 +216,5 @@ void __init mxc_init_irq(void __iomem *irqbase)
for (i = 0; i < 8; i++)
__raw_writel(0, avic_base + AVIC_NIPRIORITY(i));
- /* Initialize FIQ */
- init_FIQ();
-
printk(KERN_INFO "MXC IRQ initialized\n");
}
@@ -191,9 +191,6 @@ void __init tzic_init_irq(void __iomem *irqbase)
for (i = 0; i < 4; i++, irq_base += 32)
tzic_init_gc(i, irq_base);
- /* Initialize FIQ */
- init_FIQ();
-
pr_info("TrustZone Interrupt Controller (TZIC) initialized\n");
}
@@ -532,8 +532,6 @@ void __init s3c24xx_init_irq(void)
int irqno;
int i;
- init_FIQ();
-
irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
/* first, clear all interrupts pending... */