aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/handle.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/handle.c')
-rw-r--r--kernel/irq/handle.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index fe8f45374e86..38b49a9e508a 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -338,6 +338,15 @@ irqreturn_t no_action(int cpl, void *dev_id)
338 return IRQ_NONE; 338 return IRQ_NONE;
339} 339}
340 340
341static void warn_no_thread(unsigned int irq, struct irqaction *action)
342{
343 if (test_and_set_bit(IRQTF_WARNED, &action->thread_flags))
344 return;
345
346 printk(KERN_WARNING "IRQ %d device %s returned IRQ_WAKE_THREAD "
347 "but no thread function available.", irq, action->name);
348}
349
341/** 350/**
342 * handle_IRQ_event - irq action chain handler 351 * handle_IRQ_event - irq action chain handler
343 * @irq: the interrupt number 352 * @irq: the interrupt number
@@ -361,6 +370,21 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
361 switch (ret) { 370 switch (ret) {
362 case IRQ_WAKE_THREAD: 371 case IRQ_WAKE_THREAD:
363 /* 372 /*
373 * Set result to handled so the spurious check
374 * does not trigger.
375 */
376 ret = IRQ_HANDLED;
377
378 /*
379 * Catch drivers which return WAKE_THREAD but
380 * did not set up a thread function
381 */
382 if (unlikely(!action->thread_fn)) {
383 warn_no_thread(irq, action);
384 break;
385 }
386
387 /*
364 * Wake up the handler thread for this 388 * Wake up the handler thread for this
365 * action. In case the thread crashed and was 389 * action. In case the thread crashed and was
366 * killed we just pretend that we handled the 390 * killed we just pretend that we handled the
@@ -374,11 +398,6 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
374 wake_up_process(action->thread); 398 wake_up_process(action->thread);
375 } 399 }
376 400
377 /*
378 * Set it to handled so the spurious check
379 * does not trigger.
380 */
381 ret = IRQ_HANDLED;
382 /* Fall through to add to randomness */ 401 /* Fall through to add to randomness */
383 case IRQ_HANDLED: 402 case IRQ_HANDLED:
384 status |= action->flags; 403 status |= action->flags;