Lines Matching refs:desc
36 bool irq_wait_for_poll(struct irq_desc *desc) in irq_wait_for_poll() argument
37 __must_hold(&desc->lock) in irq_wait_for_poll()
41 smp_processor_id(), desc->irq_data.irq)) in irq_wait_for_poll()
46 raw_spin_unlock(&desc->lock); in irq_wait_for_poll()
47 while (irqd_irq_inprogress(&desc->irq_data)) in irq_wait_for_poll()
49 raw_spin_lock(&desc->lock); in irq_wait_for_poll()
50 } while (irqd_irq_inprogress(&desc->irq_data)); in irq_wait_for_poll()
52 return !irqd_irq_disabled(&desc->irq_data) && desc->action; in irq_wait_for_poll()
62 static int try_one_irq(struct irq_desc *desc, bool force) in try_one_irq() argument
67 raw_spin_lock(&desc->lock); in try_one_irq()
73 if (irq_settings_is_per_cpu(desc) || in try_one_irq()
74 irq_settings_is_nested_thread(desc) || in try_one_irq()
75 irq_settings_is_polled(desc)) in try_one_irq()
82 if (irqd_irq_disabled(&desc->irq_data) && !force) in try_one_irq()
89 action = desc->action; in try_one_irq()
95 if (irqd_irq_inprogress(&desc->irq_data)) { in try_one_irq()
100 desc->istate |= IRQS_PENDING; in try_one_irq()
105 desc->istate |= IRQS_POLL_INPROGRESS; in try_one_irq()
107 if (handle_irq_event(desc) == IRQ_HANDLED) in try_one_irq()
110 action = desc->action; in try_one_irq()
111 } while ((desc->istate & IRQS_PENDING) && action); in try_one_irq()
112 desc->istate &= ~IRQS_POLL_INPROGRESS; in try_one_irq()
114 raw_spin_unlock(&desc->lock); in try_one_irq()
120 struct irq_desc *desc; in misrouted_irq() local
128 for_each_irq_desc(i, desc) { in misrouted_irq()
135 if (try_one_irq(desc, false)) in misrouted_irq()
146 struct irq_desc *desc; in poll_spurious_irqs() local
153 for_each_irq_desc(i, desc) { in poll_spurious_irqs()
160 state = desc->istate; in poll_spurious_irqs()
166 try_one_irq(desc, true); in poll_spurious_irqs()
192 static void __report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret) in __report_bad_irq() argument
194 unsigned int irq = irq_desc_get_irq(desc); in __report_bad_irq()
214 raw_spin_lock_irqsave(&desc->lock, flags); in __report_bad_irq()
215 for_each_action_of_desc(desc, action) { in __report_bad_irq()
222 raw_spin_unlock_irqrestore(&desc->lock, flags); in __report_bad_irq()
225 static void report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret) in report_bad_irq() argument
231 __report_bad_irq(desc, action_ret); in report_bad_irq()
236 try_misrouted_irq(unsigned int irq, struct irq_desc *desc, in try_misrouted_irq() argument
265 action = desc->action; in try_misrouted_irq()
272 void note_interrupt(struct irq_desc *desc, irqreturn_t action_ret) in note_interrupt() argument
276 if (desc->istate & IRQS_POLL_INPROGRESS || in note_interrupt()
277 irq_settings_is_polled(desc)) in note_interrupt()
281 report_bad_irq(desc, action_ret); in note_interrupt()
322 if (!(desc->threads_handled_last & SPURIOUS_DEFERRED)) { in note_interrupt()
323 desc->threads_handled_last |= SPURIOUS_DEFERRED; in note_interrupt()
338 handled = atomic_read(&desc->threads_handled); in note_interrupt()
340 if (handled != desc->threads_handled_last) { in note_interrupt()
350 desc->threads_handled_last = handled; in note_interrupt()
381 desc->threads_handled_last &= ~SPURIOUS_DEFERRED; in note_interrupt()
392 if (time_after(jiffies, desc->last_unhandled + HZ/10)) in note_interrupt()
393 desc->irqs_unhandled = 1; in note_interrupt()
395 desc->irqs_unhandled++; in note_interrupt()
396 desc->last_unhandled = jiffies; in note_interrupt()
399 irq = irq_desc_get_irq(desc); in note_interrupt()
400 if (unlikely(try_misrouted_irq(irq, desc, action_ret))) { in note_interrupt()
403 desc->irqs_unhandled -= ok; in note_interrupt()
406 if (likely(!desc->irqs_unhandled)) in note_interrupt()
410 desc->irq_count++; in note_interrupt()
411 if (likely(desc->irq_count < 100000)) in note_interrupt()
414 desc->irq_count = 0; in note_interrupt()
415 if (unlikely(desc->irqs_unhandled > 99900)) { in note_interrupt()
419 __report_bad_irq(desc, action_ret); in note_interrupt()
424 desc->istate |= IRQS_SPURIOUS_DISABLED; in note_interrupt()
425 desc->depth++; in note_interrupt()
426 irq_disable(desc); in note_interrupt()
431 desc->irqs_unhandled = 0; in note_interrupt()