Re: [RFC patch 3/5] genirq: add threaded interrupt handler support

From: Steven Rostedt
Date: Thu Oct 02 2008 - 01:01:45 EST



On Wed, 1 Oct 2008, Thomas Gleixner wrote:
> #define irqreturn_t enum irqreturn
> Index: linux-2.6-tip/kernel/irq/handle.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/irq/handle.c
> +++ linux-2.6-tip/kernel/irq/handle.c
> @@ -143,13 +143,34 @@ irqreturn_t handle_IRQ_event(unsigned in
> ret = IRQ_NEEDS_HANDLING;
>
> switch (ret) {
> - default:
> + case IRQ_NEEDS_HANDLING:
> + if (!(action->flags & IRQF_THREADED)) {
> + ret = action->handler(irq, action->dev_id);
> + if (ret == IRQ_HANDLED)
> + status |= action->flags;
> + break;
> + }
> + /*
> + * Warn once when a quick check handler asked
> + * for invoking the threaded (main) handler
> + * directly
> + */
> + WARN(!(action->flags & IRQF_WARNED_THREADED),
> + "IRQ %d requested to run threaded handler "
> + "in hard interrupt context\n", irq);
> + set_bit(IRQF_WARNED_THREADED, &action->flags);

Do you purposely fall through to the next case statement here?
If so, could you please add a comment.

/* fall through */

or something similar so we know it's not a bug.

> +
> + case IRQ_WAKE_THREAD:
> + set_bit(IRQF_RUNTHREAD, &action->flags);
> + wake_up_process(action->thread);
> + /*
> + * Set it to handled so the spurious check
> + * does not trigger.
> + */
> + ret = IRQ_HANDLED;
> break;
>
> - case IRQ_NEEDS_HANDLING:
> - ret = action->handler(irq, action->dev_id);
> - if (ret == IRQ_HANDLED)
> - status |= action->flags;
> + default:
> break;
> }
> retval |= ret;


-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/