Re: [PATCH v2 3/4] rust: completion: add complete()
From: Gary Guo
Date: Thu Jul 02 2026 - 10:53:17 EST
On Sat Jun 20, 2026 at 9:45 AM BST, Maurice Hieronymus wrote:
> The initial completion abstraction only added complete_all() and
> wait_for_completion(). complete_all() marks the completion permanently
> done, which makes a single Completion unsuitable for signalling the same
> event repeatedly: once complete_all() has run, every subsequent
> wait_for_completion() returns immediately without waiting.
>
> Add complete(), which wakes a single waiter and increments the internal
> counter by one. Paired one-to-one with wait_for_completion(), it allows
> the same completion to be reused across multiple cycles, e.g. to wait for
> consecutive DMA transfers to finish.
>
> Signed-off-by: Maurice Hieronymus <mhi@xxxxxxxxxxx>
Acked-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> rust/kernel/sync/completion.rs | 11 +++++++++++
> 1 file changed, 11 insertions(+)