diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-08 06:36:06 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-19 06:58:17 -0500 |
commit | 6e40262ea43c4b0e3f435b3a083e4461ef921c17 (patch) | |
tree | 4548c1607f81701b77c0d63b544096cdee8ccde0 /kernel | |
parent | 2a0d6fb335d4428285dab2d254911748e6040807 (diff) |
genirq: Move IRQ_MASKED to core
Keep status in sync until all users are fixed.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/chip.c | 28 | ||||
-rw-r--r-- | kernel/irq/compat.h | 11 | ||||
-rw-r--r-- | kernel/irq/internals.h | 4 | ||||
-rw-r--r-- | kernel/irq/manage.c | 5 | ||||
-rw-r--r-- | kernel/irq/migration.c | 2 | ||||
-rw-r--r-- | kernel/irq/settings.h | 2 |
6 files changed, 40 insertions, 12 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 17c87865bfb1..73b2e7e00934 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -176,6 +176,18 @@ static void irq_state_set_disabled(struct irq_desc *desc) | |||
176 | irq_compat_set_disabled(desc); | 176 | irq_compat_set_disabled(desc); |
177 | } | 177 | } |
178 | 178 | ||
179 | static void irq_state_clr_masked(struct irq_desc *desc) | ||
180 | { | ||
181 | desc->istate &= ~IRQS_MASKED; | ||
182 | irq_compat_clr_masked(desc); | ||
183 | } | ||
184 | |||
185 | static void irq_state_set_masked(struct irq_desc *desc) | ||
186 | { | ||
187 | desc->istate |= IRQS_MASKED; | ||
188 | irq_compat_set_masked(desc); | ||
189 | } | ||
190 | |||
179 | int irq_startup(struct irq_desc *desc) | 191 | int irq_startup(struct irq_desc *desc) |
180 | { | 192 | { |
181 | irq_state_clr_disabled(desc); | 193 | irq_state_clr_disabled(desc); |
@@ -183,7 +195,7 @@ int irq_startup(struct irq_desc *desc) | |||
183 | 195 | ||
184 | if (desc->irq_data.chip->irq_startup) { | 196 | if (desc->irq_data.chip->irq_startup) { |
185 | int ret = desc->irq_data.chip->irq_startup(&desc->irq_data); | 197 | int ret = desc->irq_data.chip->irq_startup(&desc->irq_data); |
186 | desc->status &= ~IRQ_MASKED; | 198 | irq_state_clr_masked(desc); |
187 | return ret; | 199 | return ret; |
188 | } | 200 | } |
189 | 201 | ||
@@ -201,7 +213,7 @@ void irq_shutdown(struct irq_desc *desc) | |||
201 | desc->irq_data.chip->irq_disable(&desc->irq_data); | 213 | desc->irq_data.chip->irq_disable(&desc->irq_data); |
202 | else | 214 | else |
203 | desc->irq_data.chip->irq_mask(&desc->irq_data); | 215 | desc->irq_data.chip->irq_mask(&desc->irq_data); |
204 | desc->status |= IRQ_MASKED; | 216 | irq_state_set_masked(desc); |
205 | } | 217 | } |
206 | 218 | ||
207 | void irq_enable(struct irq_desc *desc) | 219 | void irq_enable(struct irq_desc *desc) |
@@ -211,7 +223,7 @@ void irq_enable(struct irq_desc *desc) | |||
211 | desc->irq_data.chip->irq_enable(&desc->irq_data); | 223 | desc->irq_data.chip->irq_enable(&desc->irq_data); |
212 | else | 224 | else |
213 | desc->irq_data.chip->irq_unmask(&desc->irq_data); | 225 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
214 | desc->status &= ~IRQ_MASKED; | 226 | irq_state_clr_masked(desc); |
215 | } | 227 | } |
216 | 228 | ||
217 | void irq_disable(struct irq_desc *desc) | 229 | void irq_disable(struct irq_desc *desc) |
@@ -219,8 +231,8 @@ void irq_disable(struct irq_desc *desc) | |||
219 | irq_state_set_disabled(desc); | 231 | irq_state_set_disabled(desc); |
220 | if (desc->irq_data.chip->irq_disable) { | 232 | if (desc->irq_data.chip->irq_disable) { |
221 | desc->irq_data.chip->irq_disable(&desc->irq_data); | 233 | desc->irq_data.chip->irq_disable(&desc->irq_data); |
222 | desc->status |= IRQ_MASKED; | ||
223 | } | 234 | } |
235 | irq_state_set_masked(desc); | ||
224 | } | 236 | } |
225 | 237 | ||
226 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | 238 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED |
@@ -352,14 +364,14 @@ static inline void mask_ack_irq(struct irq_desc *desc) | |||
352 | if (desc->irq_data.chip->irq_ack) | 364 | if (desc->irq_data.chip->irq_ack) |
353 | desc->irq_data.chip->irq_ack(&desc->irq_data); | 365 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
354 | } | 366 | } |
355 | desc->status |= IRQ_MASKED; | 367 | irq_state_set_masked(desc); |
356 | } | 368 | } |
357 | 369 | ||
358 | static inline void mask_irq(struct irq_desc *desc) | 370 | static inline void mask_irq(struct irq_desc *desc) |
359 | { | 371 | { |
360 | if (desc->irq_data.chip->irq_mask) { | 372 | if (desc->irq_data.chip->irq_mask) { |
361 | desc->irq_data.chip->irq_mask(&desc->irq_data); | 373 | desc->irq_data.chip->irq_mask(&desc->irq_data); |
362 | desc->status |= IRQ_MASKED; | 374 | irq_state_set_masked(desc); |
363 | } | 375 | } |
364 | } | 376 | } |
365 | 377 | ||
@@ -367,7 +379,7 @@ static inline void unmask_irq(struct irq_desc *desc) | |||
367 | { | 379 | { |
368 | if (desc->irq_data.chip->irq_unmask) { | 380 | if (desc->irq_data.chip->irq_unmask) { |
369 | desc->irq_data.chip->irq_unmask(&desc->irq_data); | 381 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
370 | desc->status &= ~IRQ_MASKED; | 382 | irq_state_clr_masked(desc); |
371 | } | 383 | } |
372 | } | 384 | } |
373 | 385 | ||
@@ -583,7 +595,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
583 | */ | 595 | */ |
584 | if (unlikely(desc->istate & IRQS_PENDING)) { | 596 | if (unlikely(desc->istate & IRQS_PENDING)) { |
585 | if (!(desc->istate & IRQS_DISABLED) && | 597 | if (!(desc->istate & IRQS_DISABLED) && |
586 | (desc->status & IRQ_MASKED)) | 598 | (desc->istate & IRQS_MASKED)) |
587 | unmask_irq(desc); | 599 | unmask_irq(desc); |
588 | } | 600 | } |
589 | 601 | ||
diff --git a/kernel/irq/compat.h b/kernel/irq/compat.h index 0067a69781f4..593abecbcc44 100644 --- a/kernel/irq/compat.h +++ b/kernel/irq/compat.h | |||
@@ -28,6 +28,15 @@ static inline void irq_compat_clr_pending(struct irq_desc *desc) | |||
28 | { | 28 | { |
29 | desc->status &= ~IRQ_PENDING; | 29 | desc->status &= ~IRQ_PENDING; |
30 | } | 30 | } |
31 | static inline void irq_compat_set_masked(struct irq_desc *desc) | ||
32 | { | ||
33 | desc->status |= IRQ_MASKED; | ||
34 | } | ||
35 | |||
36 | static inline void irq_compat_clr_masked(struct irq_desc *desc) | ||
37 | { | ||
38 | desc->status &= ~IRQ_MASKED; | ||
39 | } | ||
31 | #else | 40 | #else |
32 | static inline void irq_compat_set_progress(struct irq_desc *desc) { } | 41 | static inline void irq_compat_set_progress(struct irq_desc *desc) { } |
33 | static inline void irq_compat_clr_progress(struct irq_desc *desc) { } | 42 | static inline void irq_compat_clr_progress(struct irq_desc *desc) { } |
@@ -35,5 +44,7 @@ static inline void irq_compat_set_disabled(struct irq_desc *desc) { } | |||
35 | static inline void irq_compat_clr_disabled(struct irq_desc *desc) { } | 44 | static inline void irq_compat_clr_disabled(struct irq_desc *desc) { } |
36 | static inline void irq_compat_set_pending(struct irq_desc *desc) { } | 45 | static inline void irq_compat_set_pending(struct irq_desc *desc) { } |
37 | static inline void irq_compat_clr_pending(struct irq_desc *desc) { } | 46 | static inline void irq_compat_clr_pending(struct irq_desc *desc) { } |
47 | static inline void irq_compat_set_masked(struct irq_desc *desc) { } | ||
48 | static inline void irq_compat_clr_masked(struct irq_desc *desc) { } | ||
38 | #endif | 49 | #endif |
39 | 50 | ||
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index fdf2524437eb..3f2fcc194dcc 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -47,6 +47,7 @@ enum { | |||
47 | * IRQS_WAITING - irq is waiting | 47 | * IRQS_WAITING - irq is waiting |
48 | * IRQS_DISABLED - irq is disabled | 48 | * IRQS_DISABLED - irq is disabled |
49 | * IRQS_PENDING - irq is pending and replayed later | 49 | * IRQS_PENDING - irq is pending and replayed later |
50 | * IRQS_MASKED - irq is masked | ||
50 | */ | 51 | */ |
51 | enum { | 52 | enum { |
52 | IRQS_AUTODETECT = 0x00000001, | 53 | IRQS_AUTODETECT = 0x00000001, |
@@ -58,6 +59,7 @@ enum { | |||
58 | IRQS_WAITING = 0x00000080, | 59 | IRQS_WAITING = 0x00000080, |
59 | IRQS_DISABLED = 0x00000100, | 60 | IRQS_DISABLED = 0x00000100, |
60 | IRQS_PENDING = 0x00000200, | 61 | IRQS_PENDING = 0x00000200, |
62 | IRQS_MASKED = 0x00000400, | ||
61 | }; | 63 | }; |
62 | 64 | ||
63 | #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data) | 65 | #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data) |
@@ -142,7 +144,6 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) | |||
142 | } | 144 | } |
143 | 145 | ||
144 | P(IRQ_LEVEL); | 146 | P(IRQ_LEVEL); |
145 | P(IRQ_MASKED); | ||
146 | #ifdef CONFIG_IRQ_PER_CPU | 147 | #ifdef CONFIG_IRQ_PER_CPU |
147 | P(IRQ_PER_CPU); | 148 | P(IRQ_PER_CPU); |
148 | #endif | 149 | #endif |
@@ -156,6 +157,7 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) | |||
156 | PS(IRQS_WAITING); | 157 | PS(IRQS_WAITING); |
157 | PS(IRQS_DISABLED); | 158 | PS(IRQS_DISABLED); |
158 | PS(IRQS_PENDING); | 159 | PS(IRQS_PENDING); |
160 | PS(IRQS_MASKED); | ||
159 | } | 161 | } |
160 | 162 | ||
161 | #undef P | 163 | #undef P |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index ac060814a787..83fd20194e5b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -646,8 +646,9 @@ again: | |||
646 | goto again; | 646 | goto again; |
647 | } | 647 | } |
648 | 648 | ||
649 | if (!(desc->istate & IRQS_DISABLED) && (desc->status & IRQ_MASKED)) { | 649 | if (!(desc->istate & IRQS_DISABLED) && (desc->istate & IRQS_MASKED)) { |
650 | desc->status &= ~IRQ_MASKED; | 650 | irq_compat_clr_masked(desc); |
651 | desc->istate &= ~IRQS_MASKED; | ||
651 | desc->irq_data.chip->irq_unmask(&desc->irq_data); | 652 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
652 | } | 653 | } |
653 | raw_spin_unlock_irq(&desc->lock); | 654 | raw_spin_unlock_irq(&desc->lock); |
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index 8c68cb8555a7..6f2f98480354 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c | |||
@@ -69,7 +69,7 @@ void move_native_irq(int irq) | |||
69 | * threaded interrupt with ONESHOT set, we can end up with an | 69 | * threaded interrupt with ONESHOT set, we can end up with an |
70 | * interrupt storm. | 70 | * interrupt storm. |
71 | */ | 71 | */ |
72 | masked = desc->status & IRQ_MASKED; | 72 | masked = desc->istate & IRQS_MASKED; |
73 | if (!masked) | 73 | if (!masked) |
74 | desc->irq_data.chip->irq_mask(&desc->irq_data); | 74 | desc->irq_data.chip->irq_mask(&desc->irq_data); |
75 | move_masked_irq(irq); | 75 | move_masked_irq(irq); |
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h index 623fcf83e7de..2cd45fd5ec8a 100644 --- a/kernel/irq/settings.h +++ b/kernel/irq/settings.h | |||
@@ -16,3 +16,5 @@ enum { | |||
16 | #define IRQ_DISABLED GOT_YOU_MORON | 16 | #define IRQ_DISABLED GOT_YOU_MORON |
17 | #undef IRQ_PENDING | 17 | #undef IRQ_PENDING |
18 | #define IRQ_PENDING GOT_YOU_MORON | 18 | #define IRQ_PENDING GOT_YOU_MORON |
19 | #undef IRQ_MASKED | ||
20 | #define IRQ_MASKED GOT_YOU_MORON | ||