diff options
author | David Howells <dhowells@redhat.com> | 2006-09-26 02:32:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:53 -0400 |
commit | 88d6e19900366781739df033e9c0e2532e715fa5 (patch) | |
tree | 97c6d48f0d707002c8239efb6e865a0133d69b68 /arch/frv/kernel/irq-mb93091.c | |
parent | 1bcbba306048ed86b935d57a95d887c23d52c94b (diff) |
[PATCH] FRV: improve FRV's use of generic IRQ handling
Improve FRV's use of generic IRQ handling:
(*) Use generic_handle_irq() rather than __do_IRQ() as the latter is obsolete.
(*) Don't implement enable() and disable() ops as these will fall back to
using unmask() and mask().
(*) Provide mask_ack() functions to avoid a call each to mask() and ack().
(*) Make the cascade handlers always return IRQ_HANDLED.
(*) Implement the mask() and unmask() functions in the same order as they're
listed in the ops table.
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/frv/kernel/irq-mb93091.c')
-rw-r--r-- | arch/frv/kernel/irq-mb93091.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c index 635d23437666..369bc0a7443d 100644 --- a/arch/frv/kernel/irq-mb93091.c +++ b/arch/frv/kernel/irq-mb93091.c | |||
@@ -36,41 +36,45 @@ | |||
36 | /* | 36 | /* |
37 | * on-motherboard FPGA PIC operations | 37 | * on-motherboard FPGA PIC operations |
38 | */ | 38 | */ |
39 | static void frv_fpga_enable(unsigned int irq) | 39 | static void frv_fpga_mask(unsigned int irq) |
40 | { | 40 | { |
41 | uint16_t imr = __get_IMR(); | 41 | uint16_t imr = __get_IMR(); |
42 | 42 | ||
43 | imr &= ~(1 << (irq - IRQ_BASE_FPGA)); | 43 | imr |= 1 << (irq - IRQ_BASE_FPGA); |
44 | 44 | ||
45 | __set_IMR(imr); | 45 | __set_IMR(imr); |
46 | } | 46 | } |
47 | 47 | ||
48 | static void frv_fpga_disable(unsigned int irq) | 48 | static void frv_fpga_ack(unsigned int irq) |
49 | { | ||
50 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); | ||
51 | } | ||
52 | |||
53 | static void frv_fpga_mask_ack(unsigned int irq) | ||
49 | { | 54 | { |
50 | uint16_t imr = __get_IMR(); | 55 | uint16_t imr = __get_IMR(); |
51 | 56 | ||
52 | imr |= 1 << (irq - IRQ_BASE_FPGA); | 57 | imr |= 1 << (irq - IRQ_BASE_FPGA); |
53 | |||
54 | __set_IMR(imr); | 58 | __set_IMR(imr); |
55 | } | ||
56 | 59 | ||
57 | static void frv_fpga_ack(unsigned int irq) | ||
58 | { | ||
59 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); | 60 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); |
60 | } | 61 | } |
61 | 62 | ||
62 | static void frv_fpga_end(unsigned int irq) | 63 | static void frv_fpga_unmask(unsigned int irq) |
63 | { | 64 | { |
65 | uint16_t imr = __get_IMR(); | ||
66 | |||
67 | imr &= ~(1 << (irq - IRQ_BASE_FPGA)); | ||
68 | |||
69 | __set_IMR(imr); | ||
64 | } | 70 | } |
65 | 71 | ||
66 | static struct irq_chip frv_fpga_pic = { | 72 | static struct irq_chip frv_fpga_pic = { |
67 | .name = "mb93091", | 73 | .name = "mb93091", |
68 | .enable = frv_fpga_enable, | ||
69 | .disable = frv_fpga_disable, | ||
70 | .ack = frv_fpga_ack, | 74 | .ack = frv_fpga_ack, |
71 | .mask = frv_fpga_disable, | 75 | .mask = frv_fpga_mask, |
72 | .unmask = frv_fpga_enable, | 76 | .mask_ack = frv_fpga_mask_ack, |
73 | .end = frv_fpga_end, | 77 | .unmask = frv_fpga_unmask, |
74 | }; | 78 | }; |
75 | 79 | ||
76 | /* | 80 | /* |
@@ -79,7 +83,6 @@ static struct irq_chip frv_fpga_pic = { | |||
79 | static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs) | 83 | static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs) |
80 | { | 84 | { |
81 | uint16_t imr, mask = (unsigned long) _mask; | 85 | uint16_t imr, mask = (unsigned long) _mask; |
82 | irqreturn_t iret = 0; | ||
83 | 86 | ||
84 | imr = __get_IMR(); | 87 | imr = __get_IMR(); |
85 | mask = mask & ~imr & __get_IFR(); | 88 | mask = mask & ~imr & __get_IFR(); |
@@ -92,11 +95,10 @@ static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs) | |||
92 | irq = 31 - irq; | 95 | irq = 31 - irq; |
93 | mask &= ~(1 << irq); | 96 | mask &= ~(1 << irq); |
94 | 97 | ||
95 | if (__do_IRQ(IRQ_BASE_FPGA + irq, regs)) | 98 | generic_handle_irq(IRQ_BASE_FPGA + irq, regs); |
96 | iret |= IRQ_HANDLED; | ||
97 | } | 99 | } |
98 | 100 | ||
99 | return iret; | 101 | return IRQ_HANDLED; |
100 | } | 102 | } |
101 | 103 | ||
102 | /* | 104 | /* |