diff options
Diffstat (limited to 'debian/patches-rt/0001-workqueue-Don-t-assume-that-the-callback-has-interru.patch')
-rw-r--r-- | debian/patches-rt/0001-workqueue-Don-t-assume-that-the-callback-has-interru.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/patches-rt/0001-workqueue-Don-t-assume-that-the-callback-has-interru.patch b/debian/patches-rt/0001-workqueue-Don-t-assume-that-the-callback-has-interru.patch new file mode 100644 index 000000000..abb18a33f --- /dev/null +++ b/debian/patches-rt/0001-workqueue-Don-t-assume-that-the-callback-has-interru.patch @@ -0,0 +1,36 @@ +From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Date: Tue, 11 Jun 2019 11:21:02 +0200 +Subject: [PATCH 1/4] workqueue: Don't assume that the callback has interrupts + disabled +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz + +Due to the TIMER_IRQSAFE flag, the timer callback is invoked with +disabled interrupts. On -RT the callback is invoked in softirq context +with enabled interrupts. Since the interrupts are threaded, there are +are no in_irq() users. The local_bh_disable() around the threaded +handler ensures that there is either a timer or a threaded handler +active on the CPU. + +Disable interrupts before __queue_work() is invoked from the timer +callback. + +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + kernel/workqueue.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -1605,9 +1605,11 @@ EXPORT_SYMBOL_GPL(queue_work_node); + void delayed_work_timer_fn(struct timer_list *t) + { + struct delayed_work *dwork = from_timer(dwork, t, timer); ++ unsigned long flags; + +- /* should have been called from irqsafe timer with irq already off */ ++ local_irq_save(flags); + __queue_work(dwork->cpu, dwork->wq, &dwork->work); ++ local_irq_restore(flags); + } + EXPORT_SYMBOL(delayed_work_timer_fn); + |