git: fbc89a8cd81b - main - linuxkpi: Add `kthread_run_worker()`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Mon, 07 Sep 2026 18:37:22 UTC
The branch main has been updated by dumbbell:

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

commit fbc89a8cd81b27d9d5de3a91bfd4626cf0f7ebbc
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-06-17 16:58:11 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-09-07 18:27:29 +0000

    linuxkpi: Add `kthread_run_worker()`
    
    On Linux, `kthread_run_worker()` differs from `kthread_create_worker()`
    by waking up the task after creating it with `kthread_create_worker()`.
    
    On FreeBSD, we already execute it and wait for it, so probably no need
    to do anything further. Therefore, `kthread_run_worker()` is an alias to
    `kthread_create_worker()`.
    
    The DRM drivers generic code started to replace
    `kthread_create_worker()` by `kthread_run_worker()` as is in Linux 6.14.
    
    Reviewed by:    bz
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D57701
---
 sys/compat/linuxkpi/common/include/linux/kthread.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/kthread.h b/sys/compat/linuxkpi/common/include/linux/kthread.h
index 1fde734fd767..87db8fc71377 100644
--- a/sys/compat/linuxkpi/common/include/linux/kthread.h
+++ b/sys/compat/linuxkpi/common/include/linux/kthread.h
@@ -110,6 +110,17 @@ task_fn_t lkpi_kthread_worker_init_fn;
 	__w;								\
 })
 
+/*
+ * On Linux, `kthread_run_worker()` differs from `kthread_create_worker()` by
+ * waking up the task after creating it with `kthread_create_worker()`.
+ *
+ * On FreeBSD, we already execute it and wait for it, so probably no need to do
+ * anything further. Therefore, `kthread_run_worker()` is an alias to
+ * `kthread_create_worker()`.
+ */
+#define	kthread_run_worker(flags, fmt, ...)				\
+	kthread_create_worker(flags, fmt, ##__VA_ARGS__)
+
 static inline void
 kthread_destroy_worker(struct kthread_worker *worker)
 {