From: tip-bot for Thomas Gleixner <tglx@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
torvalds@linux-foundation.org, mtosatti@redhat.com,
jan.kiszka@web.de, tglx@linutronix.de, avi@redhat.com
Subject: [tip:irq/urgent] genirq: Allow irq chips to mark themself oneshot safe
Date: Wed, 25 Jul 2012 03:53:04 -0700 [thread overview]
Message-ID: <tip-dc9b229a58dc0dfed34272ff26c6d5fd17c674e0@git.kernel.org> (raw)
In-Reply-To: <alpine.LFD.2.02.1207132056540.32033@ionos>
Commit-ID: dc9b229a58dc0dfed34272ff26c6d5fd17c674e0
Gitweb: http://git.kernel.org/tip/dc9b229a58dc0dfed34272ff26c6d5fd17c674e0
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri, 13 Jul 2012 19:29:45 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 25 Jul 2012 12:46:38 +0200
genirq: Allow irq chips to mark themself oneshot safe
Some interrupt chips like MSI are oneshot safe by implementation. For
those interrupts we can avoid the mask/unmask sequence for threaded
interrupt handlers.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1207132056540.32033@ionos
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Jan Kiszka <jan.kiszka@web.de>
---
include/linux/irq.h | 1 +
kernel/irq/manage.c | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 553fb66..216b0ba 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -349,6 +349,7 @@ enum {
IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
IRQCHIP_SKIP_SET_WAKE = (1 << 4),
+ IRQCHIP_ONESHOT_SAFE = (1 << 5),
};
/* This include will go away once we isolated irq_desc usage to core code */
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 8c54823..2e326d1 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -960,6 +960,18 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
}
/*
+ * Drivers are often written to work w/o knowledge about the
+ * underlying irq chip implementation, so a request for a
+ * threaded irq without a primary hard irq context handler
+ * requires the ONESHOT flag to be set. Some irq chips like
+ * MSI based interrupts are per se one shot safe. Check the
+ * chip flags, so we can avoid the unmask dance at the end of
+ * the threaded handler for those.
+ */
+ if (desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)
+ new->flags &= ~IRQF_ONESHOT;
+
+ /*
* The following block of code has to be executed atomically
*/
raw_spin_lock_irqsave(&desc->lock, flags);
@@ -1033,7 +1045,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
*/
new->thread_mask = 1 << ffz(thread_mask);
- } else if (new->handler == irq_default_primary_handler) {
+ } else if (new->handler == irq_default_primary_handler &&
+ !(desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)) {
/*
* The interrupt was requested with handler = NULL, so
* we use the default primary handler for it. But it
next prev parent reply other threads:[~2012-07-25 10:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 11:55 [GIT PULL] KVM fixes for 3.5-rc6 Avi Kivity
2012-07-13 15:45 ` Linus Torvalds
2012-07-13 15:58 ` Linus Torvalds
2012-07-13 18:28 ` Thomas Gleixner
2012-07-13 18:53 ` Linus Torvalds
2012-07-13 19:02 ` Thomas Gleixner
2012-07-25 10:53 ` tip-bot for Thomas Gleixner [this message]
2012-07-14 2:25 ` Thomas Gleixner
2012-07-14 7:00 ` Jan Kiszka
2012-07-14 11:16 ` Thomas Gleixner
2012-07-14 11:23 ` Jan Kiszka
2012-07-14 12:33 ` Thomas Gleixner
2012-07-14 12:55 ` Jan Kiszka
2012-07-16 11:36 ` Avi Kivity
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-dc9b229a58dc0dfed34272ff26c6d5fd17c674e0@git.kernel.org \
--to=tglx@linutronix.de \
--cc=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=jan.kiszka@web.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mtosatti@redhat.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.