Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: fiq: change FIQ_START to a variable

The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
makes mach/irqs.h only be included for !SPARSE_IRQ build. There are
a nubmer of platforms have FIQ_START defined in mach/irqs.h for FIQ
support.

arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START 64
arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START IRQ_EINT0
arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0

If SPARSE_IRQ is enabled for any of these platforms, the following
compile error will be seen.

arch/arm/kernel/fiq.c: In function ‘enable_fiq’:
arch/arm/kernel/fiq.c:127:19: error: ‘FIQ_START’ undeclared (first use in this function)
arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/kernel/fiq.c: In function ‘disable_fiq’:
arch/arm/kernel/fiq.c:132:20: error: ‘FIQ_START’ undeclared (first use in this function)

The patch changes fiq code to have init_FIQ take FIQ_START from
platforms as a parameter and assign it to variable fiq_start which
is to replace FIQ_START uses in enable_fiq/disable_fiq.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

Shawn Guo bc89663a 1ee8f65b

+11 -8
+1 -1
arch/arm/include/asm/mach/irq.h
··· 17 17 /* 18 18 * This is internal. Do not use it. 19 19 */ 20 - extern void init_FIQ(void); 20 + extern void init_FIQ(int); 21 21 extern int show_fiq_list(struct seq_file *, int); 22 22 23 23 #ifdef CONFIG_MULTI_IRQ_HANDLER
+6 -3
arch/arm/kernel/fiq.c
··· 122 122 while (current_fiq->fiq_op(current_fiq->dev_id, 0)); 123 123 } 124 124 125 + static int fiq_start; 126 + 125 127 void enable_fiq(int fiq) 126 128 { 127 - enable_irq(fiq + FIQ_START); 129 + enable_irq(fiq + fiq_start); 128 130 } 129 131 130 132 void disable_fiq(int fiq) 131 133 { 132 - disable_irq(fiq + FIQ_START); 134 + disable_irq(fiq + fiq_start); 133 135 } 134 136 135 137 EXPORT_SYMBOL(set_fiq_handler); ··· 142 140 EXPORT_SYMBOL(enable_fiq); 143 141 EXPORT_SYMBOL(disable_fiq); 144 142 145 - void __init init_FIQ(void) 143 + void __init init_FIQ(int start) 146 144 { 147 145 no_fiq_insn = *(unsigned long *)0xffff001c; 146 + fiq_start = start; 148 147 }
+1 -1
arch/arm/mach-rpc/irq.c
··· 163 163 } 164 164 } 165 165 166 - init_FIQ(); 166 + init_FIQ(FIQ_START); 167 167 } 168 168
+1 -1
arch/arm/plat-mxc/avic.c
··· 217 217 218 218 #ifdef CONFIG_FIQ 219 219 /* Initialize FIQ */ 220 - init_FIQ(); 220 + init_FIQ(FIQ_START); 221 221 #endif 222 222 223 223 printk(KERN_INFO "MXC IRQ initialized\n");
+1 -1
arch/arm/plat-mxc/tzic.c
··· 192 192 193 193 #ifdef CONFIG_FIQ 194 194 /* Initialize FIQ */ 195 - init_FIQ(); 195 + init_FIQ(FIQ_START); 196 196 #endif 197 197 198 198 pr_info("TrustZone Interrupt Controller (TZIC) initialized\n");
+1 -1
arch/arm/plat-s3c24xx/irq.c
··· 533 533 int i; 534 534 535 535 #ifdef CONFIG_FIQ 536 - init_FIQ(); 536 + init_FIQ(FIQ_START); 537 537 #endif 538 538 539 539 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");