[PATCH v2 0/1] rust: add Work::disable_sync

Onur Özkan posted 1 patch 1 month, 1 week ago
rust/kernel/workqueue.rs | 121 ++++++++++++++++++++++++++-------------
1 file changed, 81 insertions(+), 40 deletions(-)
[PATCH v2 0/1] rust: add Work::disable_sync
Posted by Onur Özkan 1 month, 1 week ago
The immediate motivation is the Tyr reset infrastructure [1] which needs
to stop queued or running reset work during teardown before dropping the
resources used by that work. The reset series started to require too many
independent dependencies, so this is split out as a standalone change to
keep the reset series focused on the reset logic and easier to review,
rebase and land.

[1]: https://lore.kernel.org/all/20260416171728.205141-1-work@onurozkan.dev

Changes since v1:
- Fixed a soundness issue where Work::disable_sync() could make a later
  Pin<KBox<T>> enqueue fail and hit unreachable_unchecked().
- Removed the WorkItemPointer::cancel() helper and explicitly call drop()
  in disable_sync() after C has already canceled the work.

v1: https://lore.kernel.org/all/20260428104459.174602-1-work@onurozkan.dev

Onur Özkan (1):
  rust: add Work::disable_sync

 rust/kernel/workqueue.rs | 121 ++++++++++++++++++++++++++-------------
 1 file changed, 81 insertions(+), 40 deletions(-)

-- 
2.51.2

Re: [PATCH v2 0/1] rust: add Work::disable_sync
Posted by Alice Ryhl 1 month, 1 week ago
On Fri, May 01, 2026 at 10:11:21PM +0300, Onur Özkan wrote:
> The immediate motivation is the Tyr reset infrastructure [1] which needs
> to stop queued or running reset work during teardown before dropping the
> resources used by that work. The reset series started to require too many
> independent dependencies, so this is split out as a standalone change to
> keep the reset series focused on the reset logic and easier to review,
> rebase and land.
> 
> [1]: https://lore.kernel.org/all/20260416171728.205141-1-work@onurozkan.dev

The fact that it's motivated by Tyr could be in the commit message
itself.

> Changes since v1:
> - Fixed a soundness issue where Work::disable_sync() could make a later
>   Pin<KBox<T>> enqueue fail and hit unreachable_unchecked().
> - Removed the WorkItemPointer::cancel() helper and explicitly call drop()
>   in disable_sync() after C has already canceled the work.
> 
> v1: https://lore.kernel.org/all/20260428104459.174602-1-work@onurozkan.dev
> 
> Onur Özkan (1):
>   rust: add Work::disable_sync
> 
>  rust/kernel/workqueue.rs | 121 ++++++++++++++++++++++++++-------------
>  1 file changed, 81 insertions(+), 40 deletions(-)
> 
> -- 
> 2.51.2
>