lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 3/3] genirq: Do not test disabled IRQs with DEBUG_SHIRQ
Date
Testing events during freeing of disabled shared interrupts
(CONFIG_DEBUG_SHIRQ) leads to false positives. The driver disabled
interrupts on purpose to be sure that they will not fire during device
removal.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

Changes since v1:
1. New patch.
---
kernel/irq/manage.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 761911168438..f19f0dedc30d 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1775,12 +1775,14 @@ static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id)
/*
* It's a shared IRQ -- the driver ought to be prepared for an IRQ
* event to happen even now it's being freed, so let's make sure that
- * is so by doing an extra call to the handler ....
+ * is so by doing an extra call to the handler.
+ * Although the driver could disable the interrupts just before freeing
+ * just to avoid such trouble - don't test it then.
*
* ( We do this after actually deregistering it, to make sure that a
* 'real' IRQ doesn't run in parallel with our fake. )
*/
- if (action->flags & IRQF_SHARED) {
+ if (action->flags & IRQF_SHARED && !desc->depth) {
local_irq_save(flags);
action->handler(irq, dev_id);
local_irq_restore(flags);
--
2.7.4
\
 
 \ /
  Last update: 2020-06-15 10:08    [W:0.119 / U:2.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site