diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-11-01 12:08:36 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-11-29 20:14:46 -0500 |
commit | 1603b5aca4f15b34848fb5594d0c7b6333b99144 (patch) | |
tree | 79272aa41d6510b7256df62e287676885c3960cf /arch/mips/kernel/irq-rm7000.c | |
parent | c87b6ebaea034c0e0ce86127870cf1511a307b64 (diff) |
[MIPS] IRQ cleanups
This is a big irq cleanup patch.
* Use set_irq_chip() to register irq_chip.
* Initialize .mask, .unmask, .mask_ack field. Functions for these
method are already exist in most case.
* Do not initialize .startup, .shutdown, .enable, .disable fields if
default routines provided by irq_chip_set_defaults() were suitable.
* Remove redundant irq_desc initializations.
* Remove unnecessary local_irq_save/local_irq_restore, spin_lock.
With this cleanup, it would be easy to switch to slightly lightwait
irq flow handlers (handle_level_irq(), etc.) instead of __do_IRQ().
Though whole this patch is quite large, changes in each irq_chip are
not quite simple. Please review and test on your platform. Thanks.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/irq-rm7000.c')
-rw-r--r-- | arch/mips/kernel/irq-rm7000.c | 53 |
1 files changed, 6 insertions, 47 deletions
diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c index 6b54c7109e2e..6a297e3b8899 100644 --- a/arch/mips/kernel/irq-rm7000.c +++ b/arch/mips/kernel/irq-rm7000.c | |||
@@ -29,42 +29,6 @@ static inline void mask_rm7k_irq(unsigned int irq) | |||
29 | clear_c0_intcontrol(0x100 << (irq - irq_base)); | 29 | clear_c0_intcontrol(0x100 << (irq - irq_base)); |
30 | } | 30 | } |
31 | 31 | ||
32 | static inline void rm7k_cpu_irq_enable(unsigned int irq) | ||
33 | { | ||
34 | unsigned long flags; | ||
35 | |||
36 | local_irq_save(flags); | ||
37 | unmask_rm7k_irq(irq); | ||
38 | local_irq_restore(flags); | ||
39 | } | ||
40 | |||
41 | static void rm7k_cpu_irq_disable(unsigned int irq) | ||
42 | { | ||
43 | unsigned long flags; | ||
44 | |||
45 | local_irq_save(flags); | ||
46 | mask_rm7k_irq(irq); | ||
47 | local_irq_restore(flags); | ||
48 | } | ||
49 | |||
50 | static unsigned int rm7k_cpu_irq_startup(unsigned int irq) | ||
51 | { | ||
52 | rm7k_cpu_irq_enable(irq); | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | #define rm7k_cpu_irq_shutdown rm7k_cpu_irq_disable | ||
58 | |||
59 | /* | ||
60 | * While we ack the interrupt interrupts are disabled and thus we don't need | ||
61 | * to deal with concurrency issues. Same for rm7k_cpu_irq_end. | ||
62 | */ | ||
63 | static void rm7k_cpu_irq_ack(unsigned int irq) | ||
64 | { | ||
65 | mask_rm7k_irq(irq); | ||
66 | } | ||
67 | |||
68 | static void rm7k_cpu_irq_end(unsigned int irq) | 32 | static void rm7k_cpu_irq_end(unsigned int irq) |
69 | { | 33 | { |
70 | if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) | 34 | if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) |
@@ -73,11 +37,10 @@ static void rm7k_cpu_irq_end(unsigned int irq) | |||
73 | 37 | ||
74 | static struct irq_chip rm7k_irq_controller = { | 38 | static struct irq_chip rm7k_irq_controller = { |
75 | .typename = "RM7000", | 39 | .typename = "RM7000", |
76 | .startup = rm7k_cpu_irq_startup, | 40 | .ack = mask_rm7k_irq, |
77 | .shutdown = rm7k_cpu_irq_shutdown, | 41 | .mask = mask_rm7k_irq, |
78 | .enable = rm7k_cpu_irq_enable, | 42 | .mask_ack = mask_rm7k_irq, |
79 | .disable = rm7k_cpu_irq_disable, | 43 | .unmask = unmask_rm7k_irq, |
80 | .ack = rm7k_cpu_irq_ack, | ||
81 | .end = rm7k_cpu_irq_end, | 44 | .end = rm7k_cpu_irq_end, |
82 | }; | 45 | }; |
83 | 46 | ||
@@ -87,12 +50,8 @@ void __init rm7k_cpu_irq_init(int base) | |||
87 | 50 | ||
88 | clear_c0_intcontrol(0x00000f00); /* Mask all */ | 51 | clear_c0_intcontrol(0x00000f00); /* Mask all */ |
89 | 52 | ||
90 | for (i = base; i < base + 4; i++) { | 53 | for (i = base; i < base + 4; i++) |
91 | irq_desc[i].status = IRQ_DISABLED; | 54 | set_irq_chip(i, &rm7k_irq_controller); |
92 | irq_desc[i].action = NULL; | ||
93 | irq_desc[i].depth = 1; | ||
94 | irq_desc[i].chip = &rm7k_irq_controller; | ||
95 | } | ||
96 | 55 | ||
97 | irq_base = base; | 56 | irq_base = base; |
98 | } | 57 | } |