[PATCH 0/4] rust: Add ARef support for work items

Daniel Almeida posted 4 patches 3 weeks, 1 day ago
There is a newer version of this series
rust/kernel/drm/device.rs | 66 ++++++++++++++++++++++++++++++--
rust/kernel/workqueue.rs  | 96 ++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 152 insertions(+), 10 deletions(-)
[PATCH 0/4] rust: Add ARef support for work items
Posted by Daniel Almeida 3 weeks, 1 day ago
This series adds ARef<T> support for both regular and delayed work items. 

- Patches 1 and 3 actually implement the support in workqueue.rs
- Patches 2 and 4 adds a corresponding implementation in drm::Device that
  dispatches the calls to the underlying T::Data.

This was tested on Tyr, and is actually needed in order to obtain a
&drm::Device when handling work items. This is then needed in order to
allocate GEM objects inside the work handler that processes the tiler OOM
(out of memory) events. The current series sets the stage so that the above
is possible in the future.

This is currently based on v6.19-rc5. I hope we can land all four commits
on a single tree, but otherwise let me know whether I should split the
workqueue.rs changes from the drm::Device ones and rebase accordingly.

---
Daniel Almeida (4):
      rust: workqueue: add support for ARef<T>
      rust: drm: dispatch work items to the private data
      rust: workqueue: add delayed work support for ARef<T>
      rust: drm: dispatch delayed work items to the private data

 rust/kernel/drm/device.rs | 66 ++++++++++++++++++++++++++++++--
 rust/kernel/workqueue.rs  | 96 ++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 152 insertions(+), 10 deletions(-)
---
base-commit: 0f61b1860cc3f52aef9036d7235ed1f017632193
change-id: 20260115-aref-workitem-0f57e4fb81ca

Best regards,
-- 
Daniel Almeida <daniel.almeida@collabora.com>
Re: [PATCH 0/4] rust: Add ARef support for work items
Posted by Alice Ryhl 2 weeks, 4 days ago
On Thu, Jan 15, 2026 at 09:35:56PM -0300, Daniel Almeida wrote:
> This series adds ARef<T> support for both regular and delayed work items. 
> 
> - Patches 1 and 3 actually implement the support in workqueue.rs
> - Patches 2 and 4 adds a corresponding implementation in drm::Device that
>   dispatches the calls to the underlying T::Data.
> 
> This was tested on Tyr, and is actually needed in order to obtain a
> &drm::Device when handling work items. This is then needed in order to
> allocate GEM objects inside the work handler that processes the tiler OOM
> (out of memory) events. The current series sets the stage so that the above
> is possible in the future.
> 
> This is currently based on v6.19-rc5. I hope we can land all four commits
> on a single tree, but otherwise let me know whether I should split the
> workqueue.rs changes from the drm::Device ones and rebase accordingly.

Please send a new version that CCs workqueue maintainers.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Re: [PATCH 0/4] rust: Add ARef support for work items
Posted by Daniel Almeida 2 weeks, 4 days ago

> On 20 Jan 2026, at 07:37, Alice Ryhl <aliceryhl@google.com> wrote:
> 
> On Thu, Jan 15, 2026 at 09:35:56PM -0300, Daniel Almeida wrote:
>> This series adds ARef<T> support for both regular and delayed work items. 
>> 
>> - Patches 1 and 3 actually implement the support in workqueue.rs
>> - Patches 2 and 4 adds a corresponding implementation in drm::Device that
>>  dispatches the calls to the underlying T::Data.
>> 
>> This was tested on Tyr, and is actually needed in order to obtain a
>> &drm::Device when handling work items. This is then needed in order to
>> allocate GEM objects inside the work handler that processes the tiler OOM
>> (out of memory) events. The current series sets the stage so that the above
>> is possible in the future.
>> 
>> This is currently based on v6.19-rc5. I hope we can land all four commits
>> on a single tree, but otherwise let me know whether I should split the
>> workqueue.rs changes from the drm::Device ones and rebase accordingly.
> 
> Please send a new version that CCs workqueue maintainers.
> 
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>

That was the usual “b4 prep —auto-to-cc”, perhaps we need to fix something
in MAINTAINERS?

— Daniel