LKML Archive on
 help / color / Atom feed
From: Sebastian Andrzej Siewior <>
To: Thomas Gleixner <>
	Sebastian Andrzej Siewior <>
Subject: [PATCH] irq: always set IRQF_ONESHOT if no primary handler is specified
Date: Thu,  7 Jul 2011 22:32:17 +0200
Message-ID: <> (raw)

If no primary handler is specified then a default one is assigned which
always returns IRQ_WAKE_THREAD. This handler requires the IRQF_ONESHOT
flag on LEVEL / EIO typed irqs because the source of interrupt is not
Since it is required for those users and there is no difference for others
it makes sense to add this flag unconditionally.

Signed-off-by: Sebastian Andrzej Siewior <>
A quick grep shows that drivers/staging/iio/adc/ad7816.c is the only
driver in tree doing it wrong i.e. request_threaded_irq with

There are 59 users in tree which request an edge typed interrupt. 24 of
them specify the ONEHOST flag the others don't. Both variants are valid
and identical but a consistent behavior would be nice.

There is a total of 134 users and 87 specify the irq type directly. For
the remaining 47 the type depends on initial configuration of the irq chip
or it might be specified via the device tree, dunno. 
Should that patch be accepted I suggest to remove the ONESHOT flag from
every request_th.* which uses NULL as the primary handler so we have a
consistent behavior here.

 kernel/irq/manage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 0a7840ae..3f9cd47 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1322,6 +1322,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
 		if (!thread_fn)
 			return -EINVAL;
 		handler = irq_default_primary_handler;
+		irqflags |= IRQF_ONESHOT;
 	action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);

             reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 20:32 Sebastian Andrzej Siewior [this message]
2011-07-28  9:39 ` [tip:irq/urgent] irq: Always " tip-bot for Sebastian Andrzej Siewior
2011-08-18 17:01 ` [PATCH] irq: always " Pantelis Antoniou
2011-08-18 17:22   ` Sebastian Andrzej Siewior
2011-08-18 21:34     ` Felipe Balbi
2011-08-19  7:25       ` Sebastian Andrzej Siewior
2011-08-19 10:13         ` Felipe Balbi
2011-08-22 23:45       ` Paul Walmsley
2011-08-23  5:10         ` [PATCH] tty: omap-serial: fix boot hang by converting to use a threaded IRQ handler (was Re: [PATCH] irq: always set IRQF_ONESHOT if no primary handler is specified) Paul Walmsley
2011-08-23  8:14           ` Sebastian Andrzej Siewior
2011-08-23  8:57           ` Alan Cox
2011-08-23 16:13             ` Linus Torvalds
2011-08-23 16:46               ` Thomas Gleixner
2011-08-23  9:12           ` Felipe Balbi
2011-08-23 17:21             ` Paul Walmsley
2011-08-23  9:09         ` [PATCH] irq: always set IRQF_ONESHOT if no primary handler is specified Felipe Balbi
2011-08-22 23:26   ` Paul Walmsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone