[PATCH 0/5] rust: sync: add WaitQueue infrastructure
From: Danilo Krummrich
Date: Sun Jul 26 2026 - 18:36:30 EST
Add a WaitQueue abstraction wrapping struct wait_queue_head, providing
wait_event()-style methods that take a condition closure directly.
This is needed for a (subsequent) DRM patch series to wait for in-flight file
close operations during driver unbind. The Tyr driver also needs it for "CSF
firmware responses and other GPU-driven events" [1].
Convert CondVar (and PollCondVar) to use WaitQueue internally, removing
duplicate code using WaitQueue as the base primitive.
Also replace the deprecated system_wq wrapper with system_percpu_wq and
system_dfl_wq to avoid introducing more callers generating warnings that would
need to be converted later.
[1] https://lore.kernel.org/dri-devel/20260721151423.444175-2-laura.nao@xxxxxxxxxxxxx/
Danilo Krummrich (5):
rust: task: add safe schedule_timeout() wrapper
rust: workqueue: replace deprecated system_wq with
system_{percpu,dfl}_wq
rust: sync: add WaitQueue infrastructure
rust: sync: convert CondVar and PollCondVar to use WaitQueue
rust: sync: condvar: use task::schedule_timeout()
drivers/android/binder/process.rs | 4 +-
rust/kernel/sync.rs | 6 +
rust/kernel/sync/completion.rs | 2 +-
rust/kernel/sync/condvar.rs | 104 +++-----
rust/kernel/sync/lock/spinlock.rs | 2 +-
rust/kernel/sync/poll.rs | 14 +-
rust/kernel/sync/wait.rs | 385 ++++++++++++++++++++++++++++++
rust/kernel/task.rs | 13 +
rust/kernel/workqueue.rs | 40 ++--
9 files changed, 469 insertions(+), 101 deletions(-)
create mode 100644 rust/kernel/sync/wait.rs
base-commit: 6f6629ab2185d27cbc65d7d85908159b1293c082
--
2.55.0