Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2022 21:51:55 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 185159f77c9c - stable/13 - LinuxKPI: Switch irq_work implementation back to standard taskqueue
Message-ID:  <202206012151.251Lpto6042959@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=185159f77c9cfaf2cbd5a6cb80b2c7ac0b6a3a9a

commit 185159f77c9cfaf2cbd5a6cb80b2c7ac0b6a3a9a
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2022-05-17 12:10:20 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2022-06-01 21:50:14 +0000

    LinuxKPI: Switch irq_work implementation back to standard taskqueue
    
    from fast one as dmabuf does not run callbacks from critical sections
    since drm-kmod 5.7.
    Consumers which requires fair irq_work like drm-kmod 5.4 must #define
    LKPI_IRQ_WORK_USE_FAST_TQ somewhere in source file before linux/irq_work.h
    inclusion to enable old behavior.
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D35052
    
    (cherry picked from commit 71fe907dfb03c4d89a6370ce3d161603d0f40e5e)
---
 sys/compat/linuxkpi/common/include/linux/irq_work.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/irq_work.h b/sys/compat/linuxkpi/common/include/linux/irq_work.h
index d9cf36111854..9e2bd31ddb71 100644
--- a/sys/compat/linuxkpi/common/include/linux/irq_work.h
+++ b/sys/compat/linuxkpi/common/include/linux/irq_work.h
@@ -35,6 +35,16 @@
 #include <sys/taskqueue.h>
 
 #include <linux/llist.h>
+#include <linux/workqueue.h>
+
+#define	LKPI_IRQ_WORK_STD_TQ	system_wq->taskqueue
+#define	LKPI_IRQ_WORK_FAST_TQ	linux_irq_work_tq
+
+#ifdef LKPI_IRQ_WORK_USE_FAST_TQ
+#define	LKPI_IRQ_WORK_TQ	LKPI_IRQ_WORK_FAST_TQ
+#else
+#define	LKPI_IRQ_WORK_TQ	LKPI_IRQ_WORK_STD_TQ
+#endif
 
 struct irq_work;
 typedef void (*irq_work_func_t)(struct irq_work *);
@@ -64,14 +74,14 @@ init_irq_work(struct irq_work *irqw, irq_work_func_t func)
 static inline bool
 irq_work_queue(struct irq_work *irqw)
 {
-	return (taskqueue_enqueue_flags(linux_irq_work_tq, &irqw->irq_task,
+	return (taskqueue_enqueue_flags(LKPI_IRQ_WORK_TQ, &irqw->irq_task,
 	    TASKQUEUE_FAIL_IF_PENDING) == 0);
 }
 
 static inline void
 irq_work_sync(struct irq_work *irqw)
 {
-	taskqueue_drain(linux_irq_work_tq, &irqw->irq_task);
+	taskqueue_drain(LKPI_IRQ_WORK_TQ, &irqw->irq_task);
 }
 
 #endif /* _LINUXKPI_LINUX_IRQ_WORK_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206012151.251Lpto6042959>