[PATCH v2 0/4] drm/tyr: implement GPU reset API

From: Onur Özkan

Date: Thu Apr 16 2026 - 13:17:53 EST


This series adds GPU reset handling support for Tyr in a new module
drivers/gpu/drm/tyr/driver.rs which encapsulates the low-level reset
controller internals and exposes a ResetHandle API to the driver.

This series is based on Alice's "Creation of workqueues in Rust" [1]
series.

Changes since v1:
- Removed OrderedQueue and using Alice's workqueue implementation [1] instead.
- Added Resettable trait with pre_reset and post_reset hooks to be implemented by
reset-managed hardwares.
- Added SRCU abstraction and used it to synchronize the reset work and hardware access.

3 important points:
- There is no hardware using this API yet.
- On post_reset() failure, we don't do anything for now. We should unplug the GPU (that's
what Panthor does) but we don't have the infrastructure for that yet (see [2]).
- In schedule(), similar to panthor_device_schedule_reset(), we should have a PM check
but similar to the note above, we don't have the infrastructure for that yet.

Link: https://lore.kernel.org/all/20260312-create-workqueue-v4-0-ea39c351c38f@xxxxxxxxxx/ [1]
Link: https://gitlab.freedesktop.org/panfrost/linux/-/work_items/29#note_3391826 [2]
Link: https://gitlab.freedesktop.org/panfrost/linux/-/issues/28

Onur Özkan (4):
rust: add SRCU abstraction
MAINTAINERS: add Rust SRCU files to SRCU entry
rust: add Work::disable_sync
drm/tyr: add reset management API

MAINTAINERS | 3 +
drivers/gpu/drm/tyr/driver.rs | 40 +---
drivers/gpu/drm/tyr/reset.rs | 293 +++++++++++++++++++++++++++
drivers/gpu/drm/tyr/reset/hw_gate.rs | 155 ++++++++++++++
drivers/gpu/drm/tyr/tyr.rs | 1 +
rust/helpers/helpers.c | 1 +
rust/helpers/srcu.c | 18 ++
rust/kernel/sync.rs | 2 +
rust/kernel/sync/srcu.rs | 109 ++++++++++
rust/kernel/workqueue/mod.rs | 15 ++
10 files changed, 607 insertions(+), 30 deletions(-)
create mode 100644 drivers/gpu/drm/tyr/reset.rs
create mode 100644 drivers/gpu/drm/tyr/reset/hw_gate.rs
create mode 100644 rust/helpers/srcu.c
create mode 100644 rust/kernel/sync/srcu.rs

--
2.51.2