lkml.org 
[lkml]   [2021]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] irq_work: Ensure that irq_work runs in in-IRQ context.
Date
The irq-work callback should be invoked in hardirq context and some
callbacks rely on this behaviour. At the time irq_work_run_list()
interrupts should be disabled but the important part is that the
callback is invoked from a in-IRQ context.
The "disabled interrupts" check can be satisfied by disabling interrupts
from a kworker which is not the intended context.

Ensure that the callback is invoked from hardirq context and not just
with disabled interrupts.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/irq_work.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index db8c248ebc8c8..caf2edffa20d5 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -167,7 +167,7 @@ static void irq_work_run_list(struct llist_head *list)
struct irq_work *work, *tmp;
struct llist_node *llnode;

- BUG_ON(!irqs_disabled());
+ BUG_ON(!in_hardirq());

if (llist_empty(list))
return;
--
2.33.0
\
 
 \ /
  Last update: 2021-09-27 23:21    [W:0.147 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site