[linux-yocto] [linux-yocto-rt v5.0/standard/preempt-rt/base][PATCH 1/1] genirq: invoke kthread_cancel_work_sync on RT kernel to aviod compile error

Liwei Song liwei.song at windriver.com
Thu May 23 02:54:08 PDT 2019


fix following compile error:

kernel/irq/manage.c:388:20: error: passing argument 1 of 'cancel_work_sync' from incompatible pointer type

The compile error was got with CONFIG_PREEMPT_RT_BASE enabled,
On RT kernel work_struct was replaced by kthread_work, so here
we should use kthread_cancel_work_sync() instead of cancel_work_sync()
to fix it.

Signed-off-by: Liwei Song <liwei.song at windriver.com>
---
 kernel/irq/manage.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index f72bd3a357da..143f87bbff48 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -385,7 +385,11 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	if (old_notify) {
+#ifdef CONFIG_PREEMPT_RT_BASE
+		kthread_cancel_work_sync(&old_notify->work);
+#else
 		cancel_work_sync(&old_notify->work);
+#endif
 		kref_put(&old_notify->kref, old_notify->release);
 	}
 
-- 
2.18.1



More information about the linux-yocto mailing list