lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 04 Jun 2010 23:19:12 +0200
From:	Esben Haabendal <eha@...edevelopment.dk>
To:	linux-kernel@...r.kernel.org, maz@...terjones.org,
	tglx@...utronix.de, mingo@...e.hu, joachim.eastwood@...ron.com
Subject: [RFC][PATCH] irq: support IRQ_NESTED_THREAD with non-threaded
 interrupt handlers

set_irq_nested_thread() might be called by interrupt controller to
supported nested irq thread handling, and with this change, drivers
with non-threaded irq handlers can still use the irqs.

Signed-off-by: Esben Haabendal <eha@...edevelopment.dk>
---
 kernel/irq/chip.c   |    9 ++++++++-
 kernel/irq/manage.c |    4 +---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index b7091d5..8202993 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -405,7 +405,14 @@ void handle_nested_irq(unsigned int irq)
 	desc->status |= IRQ_INPROGRESS;
 	raw_spin_unlock_irq(&desc->lock);
 
-	action_ret = action->thread_fn(action->irq, action->dev_id);
+	if (desc->status & IRQ_NESTED_THREAD && action->thread_fn)
+		action_ret = action->thread_fn(action->irq, action->dev_id);
+	else {
+		local_irq_disable();
+		action_ret = action->handler(action->irq, action->dev_id);
+		local_irq_enable();
+	}
+
 	if (!noirqdebug)
 		note_interrupt(irq, desc, action_ret);
 
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 3164ba7..e7bca04 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -681,10 +681,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 	 * Check whether the interrupt nests into another interrupt
 	 * thread.
 	 */
-	nested = desc->status & IRQ_NESTED_THREAD;
+	nested = (desc->status & IRQ_NESTED_THREAD) && new->thread_fn;
 	if (nested) {
-		if (!new->thread_fn)
-			return -EINVAL;
 		/*
 		 * Replace the primary handler which was provided from
 		 * the driver for non nested interrupt handling by the
-- 
1.7.1



--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ