autoprobe.c (e8cdfb0509f48d44d95d68d4f42d8d71a9ba4acd) autoprobe.c (4699923861513671d3f6ade8efb4e56a9a7ecadf)
1/*
2 * linux/kernel/irq/autoprobe.c
3 *
4 * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar
5 *
6 * This file contains the interrupt probing code and driver APIs.
7 */
8

--- 46 unchanged lines hidden (view full) ---

55
56 /*
57 * Some chips need to know about probing in
58 * progress:
59 */
60 if (desc->irq_data.chip->irq_set_type)
61 desc->irq_data.chip->irq_set_type(&desc->irq_data,
62 IRQ_TYPE_PROBE);
1/*
2 * linux/kernel/irq/autoprobe.c
3 *
4 * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar
5 *
6 * This file contains the interrupt probing code and driver APIs.
7 */
8

--- 46 unchanged lines hidden (view full) ---

55
56 /*
57 * Some chips need to know about probing in
58 * progress:
59 */
60 if (desc->irq_data.chip->irq_set_type)
61 desc->irq_data.chip->irq_set_type(&desc->irq_data,
62 IRQ_TYPE_PROBE);
63 desc->irq_data.chip->irq_startup(&desc->irq_data);
63 irq_startup(desc);
64 }
65 raw_spin_unlock_irq(&desc->lock);
66 }
67
68 /* Wait for longstanding interrupts to trigger. */
69 msleep(20);
70
71 /*
72 * enable any unassigned irqs
73 * (we must startup again here because if a longstanding irq
74 * happened in the previous stage, it may have masked itself)
75 */
76 for_each_irq_desc_reverse(i, desc) {
77 raw_spin_lock_irq(&desc->lock);
78 if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
79 desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
64 }
65 raw_spin_unlock_irq(&desc->lock);
66 }
67
68 /* Wait for longstanding interrupts to trigger. */
69 msleep(20);
70
71 /*
72 * enable any unassigned irqs
73 * (we must startup again here because if a longstanding irq
74 * happened in the previous stage, it may have masked itself)
75 */
76 for_each_irq_desc_reverse(i, desc) {
77 raw_spin_lock_irq(&desc->lock);
78 if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
79 desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
80 if (desc->irq_data.chip->irq_startup(&desc->irq_data))
80 if (irq_startup(desc))
81 desc->status |= IRQ_PENDING;
82 }
83 raw_spin_unlock_irq(&desc->lock);
84 }
85
86 /*
87 * Wait for spurious interrupts to trigger
88 */

--- 5 unchanged lines hidden (view full) ---

94 for_each_irq_desc(i, desc) {
95 raw_spin_lock_irq(&desc->lock);
96 status = desc->status;
97
98 if (status & IRQ_AUTODETECT) {
99 /* It triggered already - consider it spurious. */
100 if (!(status & IRQ_WAITING)) {
101 desc->status = status & ~IRQ_AUTODETECT;
81 desc->status |= IRQ_PENDING;
82 }
83 raw_spin_unlock_irq(&desc->lock);
84 }
85
86 /*
87 * Wait for spurious interrupts to trigger
88 */

--- 5 unchanged lines hidden (view full) ---

94 for_each_irq_desc(i, desc) {
95 raw_spin_lock_irq(&desc->lock);
96 status = desc->status;
97
98 if (status & IRQ_AUTODETECT) {
99 /* It triggered already - consider it spurious. */
100 if (!(status & IRQ_WAITING)) {
101 desc->status = status & ~IRQ_AUTODETECT;
102 desc->irq_data.chip->irq_shutdown(&desc->irq_data);
102 irq_shutdown(desc);
103 } else
104 if (i < 32)
105 mask |= 1 << i;
106 }
107 raw_spin_unlock_irq(&desc->lock);
108 }
109
110 return mask;

--- 22 unchanged lines hidden (view full) ---

133 raw_spin_lock_irq(&desc->lock);
134 status = desc->status;
135
136 if (status & IRQ_AUTODETECT) {
137 if (i < 16 && !(status & IRQ_WAITING))
138 mask |= 1 << i;
139
140 desc->status = status & ~IRQ_AUTODETECT;
103 } else
104 if (i < 32)
105 mask |= 1 << i;
106 }
107 raw_spin_unlock_irq(&desc->lock);
108 }
109
110 return mask;

--- 22 unchanged lines hidden (view full) ---

133 raw_spin_lock_irq(&desc->lock);
134 status = desc->status;
135
136 if (status & IRQ_AUTODETECT) {
137 if (i < 16 && !(status & IRQ_WAITING))
138 mask |= 1 << i;
139
140 desc->status = status & ~IRQ_AUTODETECT;
141 desc->irq_data.chip->irq_shutdown(&desc->irq_data);
141 irq_shutdown(desc);
142 }
143 raw_spin_unlock_irq(&desc->lock);
144 }
145 mutex_unlock(&probing_active);
146
147 return mask & val;
148}
149EXPORT_SYMBOL(probe_irq_mask);

--- 27 unchanged lines hidden (view full) ---

177
178 if (status & IRQ_AUTODETECT) {
179 if (!(status & IRQ_WAITING)) {
180 if (!nr_of_irqs)
181 irq_found = i;
182 nr_of_irqs++;
183 }
184 desc->status = status & ~IRQ_AUTODETECT;
142 }
143 raw_spin_unlock_irq(&desc->lock);
144 }
145 mutex_unlock(&probing_active);
146
147 return mask & val;
148}
149EXPORT_SYMBOL(probe_irq_mask);

--- 27 unchanged lines hidden (view full) ---

177
178 if (status & IRQ_AUTODETECT) {
179 if (!(status & IRQ_WAITING)) {
180 if (!nr_of_irqs)
181 irq_found = i;
182 nr_of_irqs++;
183 }
184 desc->status = status & ~IRQ_AUTODETECT;
185 desc->irq_data.chip->irq_shutdown(&desc->irq_data);
185 irq_shutdown(desc);
186 }
187 raw_spin_unlock_irq(&desc->lock);
188 }
189 mutex_unlock(&probing_active);
190
191 if (nr_of_irqs > 1)
192 irq_found = -irq_found;
193
194 return irq_found;
195}
196EXPORT_SYMBOL(probe_irq_off);
197
186 }
187 raw_spin_unlock_irq(&desc->lock);
188 }
189 mutex_unlock(&probing_active);
190
191 if (nr_of_irqs > 1)
192 irq_found = -irq_found;
193
194 return irq_found;
195}
196EXPORT_SYMBOL(probe_irq_off);
197