lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectgenirq: Consider domain hierarchy when checking for IRQCHIP_ONESHOT_SAFE
Date
In case of a domain hierarchy we may miss the IRQCHIP_ONESHOT_SAFE
flag because we look at top of the stack only. See also discussion
here: https://marc.info/?l=linux-kernel&m=153301773524685&w=2

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
kernel/irq/manage.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index a66c58f9..1a28f068 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1156,6 +1156,16 @@ setup_irq_thread(struct irqaction *new, unsigned int irq, bool secondary)
return 0;
}

+static bool irq_data_oneshot_safe(struct irq_data *data)
+{
+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+ /* check topmost irq_chip only */
+ while (data->parent_data)
+ data = data->parent_data;
+#endif
+ return !!(data->chip->flags & IRQCHIP_ONESHOT_SAFE);
+}
+
/*
* Internal function to register an irqaction - typically used to
* allocate special interrupts that are part of the architecture.
@@ -1243,7 +1253,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
* 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)
+ if (irq_data_oneshot_safe(&desc->irq_data))
new->flags &= ~IRQF_ONESHOT;

/*
--
2.18.0
\
 
 \ /
  Last update: 2018-08-03 21:26    [W:0.252 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site