[PATCH v7 0/3] drm/tyr: add Job IRQ handling
From: Laura Nao
Date: Mon Nov 23 2026 - 09:59:47 EST
Changes in v7:
- Rebased on top of drm-rust-next
- Added spinlock to serialize mask register writes with state
transitions, matching panthor's behavior.
- Added IrqState to track an interrupt state and coordinate
primary/threaded handlers and teardown.
- Replaced JobIrqMaskGuard with new TyrIrqRegistration struct, which
wraps a ThreadedRegistration. Its drop implementation ensures
interrupts are masked and status is updated before free_irq() is
called, preventing racing with threaded handlers running concurrently
on another CPU and a possible IRQ storm.
- Updated job_irq_init to resolve the IRQ registration into a
Pin<KBox<TyrIrqRegistration<...>>>, so it's fully initialized before
returning.
- Rebased on top of "drm/tyr: GPU reset infrastructure"[3]. Updated
code to leverage HwGate for IO operations.
- Added "drm/tyr: add HwGate::try_access_atomic()"
- Link to v6: https://lore.kernel.org/r/20260728-tyr-irq-v2-v6-0-15c90baed949@xxxxxxxxxxxxx
Changes in v6:
- Split changes into two separate commits: the first one creates a new
file with TyrIrq/TyrIrqTrait and their related impls, the second
commit imports and uses TyrIrq/TyrIrqTrait from crate::irq instead of
crate::driver
- Removed irq() accessor, unmasking the interrupts in TyrIrq::request()
by accessing the private irq field directly instead
- Add JobIrqMaskGuard to mask the Job IRQ before free_irq() runs, fixing
incorrect drop order in the IRQ teardown path
- Combined fw_ready/job_irq_wait into a separate JobIrqEvents type
- Store firmware-ready state only once and always wake waiters
unconditionally
- Clear the status once the handler has been successfully registered
- Use mask() in reenable_mask() to reduce code duplication
- Reworded commit messages to reflect the changes
- Link to v5: https://lore.kernel.org/r/20260728-tyr-irq-v2-v5-1-59fd9dea952a@xxxxxxxxxxxxx
Changes in v5:
- Implement PinnedDrop on TyrIrq to clear the interrupt mask on teardown
- Link to v4: https://lore.kernel.org/r/20260805-tyr-irq-v2-v4-1-81a4701611c0@xxxxxxxxxxxxx
Changes in v4:
- Replaced c_str! with C-String in irq.rs
- Moved clear_status() before handle() in handle_threaded(), to avoid
losing events if hw re-asserts the bit while handle() is running.
- Only unmask interrupt sources in job_irq_init() when the handler is
correctly registered.
- Link to v3: https://lore.kernel.org/r/20260728-tyr-irq-v2-v3-1-9c9bc5c029c5@xxxxxxxxxxxxx
Changes in v3:
- Propagated request_threaded_irq_by_name safety requirement up the
call chain, made TyrIrq::request() and job_irq_init() unsafe
- Dropped CSG bits masking, added TODO comment to note this will be
handled at a later stage. Reworded commit message to reflect the
change.
- Added documentation for TyrIrqTrait, TyrIrq, JobIrq and job_irq_init()
- Link to v2: https://lore.kernel.org/r/20260729-tyr-irq-v2-v2-1-c2750fc11d59@xxxxxxxxxxxxx
Changes in v2:
- Dropped Wait custom type in favor of WaitQueue
- Renamed JobIrq lifetime to generic 'a
This series follows up to [1], which adds support for firmware loading
and MCU booting to the Tyr driver. The changes included here were
originally introduced in its v4[2], then dropped to reduce the scope of
the series, and have been adjusted to work with the HRT (Higher-Ranked
Lifetime Types) driver architecture recently introduced.
The series adds a threaded IRQ wrapper for the firmware Job interrupts,
used to signal events from the global CSF (GLB) and Command Stream Group
(CSG) interfaces.
These changes will be later used to wait for global CSF interface
readiness after firmware boot, as part of the CSF firmware interfaces
support that will be submitted as a separate series.
This series is based on drm-rust-next and depends on:
- [PATCH v9 0/2] drm/tyr: GPU reset infrastructure[3] and its
dependencies
Note: A branch with all the changes is available here:
https://gitlab.freedesktop.org/laura.nao/linux/-/commits/b4/tyr-irq-v7
[1] https://lore.kernel.org/all/20260728-fw-boot-b4-v10-0-9187aefa3f2f@xxxxxxxxxxxxx/
[2] https://lore.kernel.org/rust-for-linux/20260424-b4-fw-boot-v4-v4-15-a5d91050789d@xxxxxxxxxxxxx/
[3] https://lore.kernel.org/all/20261122-tyr-reset-impl-v9-0-ed42d8f513ec@xxxxxxxxxxxxx/
Signed-off-by: Laura Nao <laura.nao@xxxxxxxxxxxxx>
---
Daniel Almeida (1):
drm/tyr: add HwGate::try_access_atomic()
Laura Nao (2):
drm/tyr: add TyrIrq threaded IRQ wrapper
drm/tyr: add Job IRQ handling
drivers/gpu/drm/tyr/fw.rs | 1 +
drivers/gpu/drm/tyr/fw/irq.rs | 148 +++++++++++++++++++
drivers/gpu/drm/tyr/irq.rs | 269 +++++++++++++++++++++++++++++++++++
drivers/gpu/drm/tyr/reset/hw_gate.rs | 54 ++++++-
drivers/gpu/drm/tyr/tyr.rs | 1 +
5 files changed, 471 insertions(+), 2 deletions(-)
---
base-commit: 746918a0c6c0c1738e74d5e198ee06c848e2ddd2
change-id: 20260728-tyr-irq-v2-0b3c5022be33
Best regards,
--
Laura Nao <laura.nao@xxxxxxxxxxxxx>