mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v7 0/3] drm/tyr: add Job IRQ handling
@ 2026-11-23 14:58 Laura Nao
  2026-11-23 14:58 ` [PATCH v7 1/3] drm/tyr: add HwGate::try_access_atomic() Laura Nao
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laura Nao @ 2026-11-23 14:58 UTC (permalink / raw)
  To: Daniel Almeida, Alice Ryhl, Danilo Krummrich, David Airlie,
	Simona Vetter, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan
  Cc: linux-kernel, dri-devel, rust-for-linux, kernel, Laura Nao,
	Deborah Brouwer

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@collabora.com

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@collabora.com

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@collabora.com

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@collabora.com

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@collabora.com

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@collabora.com/ 
[2] https://lore.kernel.org/rust-for-linux/20260424-b4-fw-boot-v4-v4-15-a5d91050789d@collabora.com/
[3] https://lore.kernel.org/all/20261122-tyr-reset-impl-v9-0-ed42d8f513ec@onurozkan.dev/ 

Signed-off-by: Laura Nao <laura.nao@collabora.com>
---
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@collabora.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-23 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 14:58 [PATCH v7 0/3] drm/tyr: add Job IRQ handling Laura Nao
2026-11-23 14:58 ` [PATCH v7 1/3] drm/tyr: add HwGate::try_access_atomic() Laura Nao
2026-11-23 18:13   ` Onur Özkan
2026-11-23 14:58 ` [PATCH v7 2/3] drm/tyr: add TyrIrq threaded IRQ wrapper Laura Nao
2026-11-23 14:58 ` [PATCH v7 3/3] drm/tyr: add Job IRQ handling Laura Nao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®