diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-08 05:39:15 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-19 06:58:16 -0500 |
commit | 163ef3091195f514a06f064b12914597d2644c55 (patch) | |
tree | a6e222b1a7366aa93c884257063aa36ef17cf91f /kernel | |
parent | 3d67baec7f1b01fc289ac1a2f1a7e6d5e43391c6 (diff) |
genirq: Move IRQ_REPLAY and IRQ_WAITING to core
No users outside of core.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/autoprobe.c | 11 | ||||
-rw-r--r-- | kernel/irq/chip.c | 9 | ||||
-rw-r--r-- | kernel/irq/internals.h | 8 | ||||
-rw-r--r-- | kernel/irq/manage.c | 4 | ||||
-rw-r--r-- | kernel/irq/resend.c | 7 | ||||
-rw-r--r-- | kernel/irq/settings.h | 4 |
6 files changed, 26 insertions, 17 deletions
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c index 916e56e10a2e..9ea8bb99f7c1 100644 --- a/kernel/irq/autoprobe.c +++ b/kernel/irq/autoprobe.c | |||
@@ -17,7 +17,7 @@ | |||
17 | /* | 17 | /* |
18 | * Autodetection depends on the fact that any interrupt that | 18 | * Autodetection depends on the fact that any interrupt that |
19 | * comes in on to an unassigned handler will get stuck with | 19 | * comes in on to an unassigned handler will get stuck with |
20 | * "IRQ_WAITING" cleared and the interrupt disabled. | 20 | * "IRQS_WAITING" cleared and the interrupt disabled. |
21 | */ | 21 | */ |
22 | static DEFINE_MUTEX(probing_active); | 22 | static DEFINE_MUTEX(probing_active); |
23 | 23 | ||
@@ -75,8 +75,7 @@ unsigned long probe_irq_on(void) | |||
75 | for_each_irq_desc_reverse(i, desc) { | 75 | for_each_irq_desc_reverse(i, desc) { |
76 | raw_spin_lock_irq(&desc->lock); | 76 | raw_spin_lock_irq(&desc->lock); |
77 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { | 77 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { |
78 | desc->istate |= IRQS_AUTODETECT; | 78 | desc->istate |= IRQS_AUTODETECT | IRQS_WAITING; |
79 | desc->status |= IRQ_WAITING; | ||
80 | if (irq_startup(desc)) | 79 | if (irq_startup(desc)) |
81 | desc->status |= IRQ_PENDING; | 80 | desc->status |= IRQ_PENDING; |
82 | } | 81 | } |
@@ -96,7 +95,7 @@ unsigned long probe_irq_on(void) | |||
96 | 95 | ||
97 | if (desc->istate & IRQS_AUTODETECT) { | 96 | if (desc->istate & IRQS_AUTODETECT) { |
98 | /* It triggered already - consider it spurious. */ | 97 | /* It triggered already - consider it spurious. */ |
99 | if (!(desc->status & IRQ_WAITING)) { | 98 | if (!(desc->istate & IRQS_WAITING)) { |
100 | desc->istate &= ~IRQS_AUTODETECT; | 99 | desc->istate &= ~IRQS_AUTODETECT; |
101 | irq_shutdown(desc); | 100 | irq_shutdown(desc); |
102 | } else | 101 | } else |
@@ -131,7 +130,7 @@ unsigned int probe_irq_mask(unsigned long val) | |||
131 | for_each_irq_desc(i, desc) { | 130 | for_each_irq_desc(i, desc) { |
132 | raw_spin_lock_irq(&desc->lock); | 131 | raw_spin_lock_irq(&desc->lock); |
133 | if (desc->istate & IRQS_AUTODETECT) { | 132 | if (desc->istate & IRQS_AUTODETECT) { |
134 | if (i < 16 && !(desc->status & IRQ_WAITING)) | 133 | if (i < 16 && !(desc->istate & IRQS_WAITING)) |
135 | mask |= 1 << i; | 134 | mask |= 1 << i; |
136 | 135 | ||
137 | desc->istate &= ~IRQS_AUTODETECT; | 136 | desc->istate &= ~IRQS_AUTODETECT; |
@@ -171,7 +170,7 @@ int probe_irq_off(unsigned long val) | |||
171 | raw_spin_lock_irq(&desc->lock); | 170 | raw_spin_lock_irq(&desc->lock); |
172 | 171 | ||
173 | if (desc->istate & IRQS_AUTODETECT) { | 172 | if (desc->istate & IRQS_AUTODETECT) { |
174 | if (!(desc->status & IRQ_WAITING)) { | 173 | if (!(desc->istate & IRQS_WAITING)) { |
175 | if (!nr_of_irqs) | 174 | if (!nr_of_irqs) |
176 | irq_found = i; | 175 | irq_found = i; |
177 | nr_of_irqs++; | 176 | nr_of_irqs++; |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 420fa6bdb117..59ae14527ecd 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -428,7 +428,7 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc) | |||
428 | if (!irq_check_poll(desc)) | 428 | if (!irq_check_poll(desc)) |
429 | goto out_unlock; | 429 | goto out_unlock; |
430 | 430 | ||
431 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 431 | desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); |
432 | kstat_incr_irqs_this_cpu(irq, desc); | 432 | kstat_incr_irqs_this_cpu(irq, desc); |
433 | 433 | ||
434 | if (unlikely(!desc->action || (desc->status & IRQ_DISABLED))) | 434 | if (unlikely(!desc->action || (desc->status & IRQ_DISABLED))) |
@@ -460,7 +460,7 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc) | |||
460 | if (!irq_check_poll(desc)) | 460 | if (!irq_check_poll(desc)) |
461 | goto out_unlock; | 461 | goto out_unlock; |
462 | 462 | ||
463 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 463 | desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); |
464 | kstat_incr_irqs_this_cpu(irq, desc); | 464 | kstat_incr_irqs_this_cpu(irq, desc); |
465 | 465 | ||
466 | /* | 466 | /* |
@@ -498,7 +498,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) | |||
498 | if (!irq_check_poll(desc)) | 498 | if (!irq_check_poll(desc)) |
499 | goto out; | 499 | goto out; |
500 | 500 | ||
501 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 501 | desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); |
502 | kstat_incr_irqs_this_cpu(irq, desc); | 502 | kstat_incr_irqs_this_cpu(irq, desc); |
503 | 503 | ||
504 | /* | 504 | /* |
@@ -537,8 +537,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
537 | { | 537 | { |
538 | raw_spin_lock(&desc->lock); | 538 | raw_spin_lock(&desc->lock); |
539 | 539 | ||
540 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 540 | desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); |
541 | |||
542 | /* | 541 | /* |
543 | * If we're currently running this IRQ, or its disabled, | 542 | * If we're currently running this IRQ, or its disabled, |
544 | * we shouldn't process the IRQ. Mark it pending, handle | 543 | * we shouldn't process the IRQ. Mark it pending, handle |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index 36563f731ff8..54037533af7a 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -43,6 +43,8 @@ enum { | |||
43 | * IRQS_POLL_INPROGRESS - polling in progress | 43 | * IRQS_POLL_INPROGRESS - polling in progress |
44 | * IRQS_INPROGRESS - Interrupt in progress | 44 | * IRQS_INPROGRESS - Interrupt in progress |
45 | * IRQS_ONESHOT - irq is not unmasked in primary handler | 45 | * IRQS_ONESHOT - irq is not unmasked in primary handler |
46 | * IRQS_REPLAY - irq is replayed | ||
47 | * IRQS_WAITING - irq is waiting | ||
46 | */ | 48 | */ |
47 | enum { | 49 | enum { |
48 | IRQS_AUTODETECT = 0x00000001, | 50 | IRQS_AUTODETECT = 0x00000001, |
@@ -50,6 +52,8 @@ enum { | |||
50 | IRQS_POLL_INPROGRESS = 0x00000008, | 52 | IRQS_POLL_INPROGRESS = 0x00000008, |
51 | IRQS_INPROGRESS = 0x00000010, | 53 | IRQS_INPROGRESS = 0x00000010, |
52 | IRQS_ONESHOT = 0x00000020, | 54 | IRQS_ONESHOT = 0x00000020, |
55 | IRQS_REPLAY = 0x00000040, | ||
56 | IRQS_WAITING = 0x00000080, | ||
53 | }; | 57 | }; |
54 | 58 | ||
55 | #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data) | 59 | #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data) |
@@ -135,8 +139,6 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) | |||
135 | 139 | ||
136 | P(IRQ_DISABLED); | 140 | P(IRQ_DISABLED); |
137 | P(IRQ_PENDING); | 141 | P(IRQ_PENDING); |
138 | P(IRQ_REPLAY); | ||
139 | P(IRQ_WAITING); | ||
140 | P(IRQ_LEVEL); | 142 | P(IRQ_LEVEL); |
141 | P(IRQ_MASKED); | 143 | P(IRQ_MASKED); |
142 | #ifdef CONFIG_IRQ_PER_CPU | 144 | #ifdef CONFIG_IRQ_PER_CPU |
@@ -148,6 +150,8 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) | |||
148 | 150 | ||
149 | PS(IRQS_AUTODETECT); | 151 | PS(IRQS_AUTODETECT); |
150 | PS(IRQS_INPROGRESS); | 152 | PS(IRQS_INPROGRESS); |
153 | PS(IRQS_REPLAY); | ||
154 | PS(IRQS_WAITING); | ||
151 | } | 155 | } |
152 | 156 | ||
153 | #undef P | 157 | #undef P |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index aca4208a03ac..7971df53d6a9 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -897,9 +897,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) | |||
897 | desc->status |= IRQ_PER_CPU; | 897 | desc->status |= IRQ_PER_CPU; |
898 | #endif | 898 | #endif |
899 | 899 | ||
900 | desc->status &= ~IRQ_WAITING; | ||
901 | desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \ | 900 | desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \ |
902 | IRQS_INPROGRESS | IRQS_ONESHOT); | 901 | IRQS_INPROGRESS | IRQS_ONESHOT | \ |
902 | IRQS_WAITING); | ||
903 | 903 | ||
904 | if (new->flags & IRQF_ONESHOT) | 904 | if (new->flags & IRQF_ONESHOT) |
905 | desc->istate |= IRQS_ONESHOT; | 905 | desc->istate |= IRQS_ONESHOT; |
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index 60b20261041b..f83387cd11f3 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c | |||
@@ -62,8 +62,11 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq) | |||
62 | */ | 62 | */ |
63 | if (desc->status & IRQ_LEVEL) | 63 | if (desc->status & IRQ_LEVEL) |
64 | return; | 64 | return; |
65 | if ((desc->status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { | 65 | if (desc->istate & IRQS_REPLAY) |
66 | desc->status = (desc->status & ~IRQ_PENDING) | IRQ_REPLAY; | 66 | return; |
67 | if (desc->status & IRQ_PENDING) { | ||
68 | desc->status &= ~IRQ_PENDING; | ||
69 | desc->istate |= IRQS_REPLAY; | ||
67 | 70 | ||
68 | if (!desc->irq_data.chip->irq_retrigger || | 71 | if (!desc->irq_data.chip->irq_retrigger || |
69 | !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) { | 72 | !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) { |
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h index a96140eea409..2e7d08fff0ce 100644 --- a/kernel/irq/settings.h +++ b/kernel/irq/settings.h | |||
@@ -8,3 +8,7 @@ enum { | |||
8 | 8 | ||
9 | #undef IRQ_INPROGRESS | 9 | #undef IRQ_INPROGRESS |
10 | #define IRQ_INPROGRESS GOT_YOU_MORON | 10 | #define IRQ_INPROGRESS GOT_YOU_MORON |
11 | #undef IRQ_REPLAY | ||
12 | #define IRQ_REPLAY GOT_YOU_MORON | ||
13 | #undef IRQ_WAITING | ||
14 | #define IRQ_WAITING GOT_YOU_MORON | ||