[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0810020058020.11373@gandalf.stny.rr.com>
Date: Thu, 2 Oct 2008 01:01:35 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: Thomas Gleixner <tglx@...utronix.de>
cc: LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...l.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
Arjan van de Veen <arjan@...radead.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Jon Masters <jonathan@...masters.org>,
Sven Dietrich <sdietrich@...e.de>
Subject: Re: [RFC patch 3/5] genirq: add threaded interrupt handler support
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists