The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v6 0/3] drm/tyr: GPU reset infrastructure
@ 2026-08-19 18:45 Onur Özkan
  2026-08-19 18:45 ` [PATCH v6 1/3] drm/tyr: clear stale IRQ state before soft reset Onur Özkan
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Onur Özkan @ 2026-08-19 18:45 UTC (permalink / raw)
  To: linux-kernel, rust-for-linux, dri-devel
  Cc: dakr, aliceryhl, daniel.almeida, airlied, simona, ojeda, boqun,
	gary, bjorn3_gh, lossin, a.hindborg, tmgross, Onur Özkan

Add support for scheduling GPU resets on a dedicated workqueue. Track
the reset state to avoid queueing another reset while one is already
pending or in progress.

Use an SRCU based gate with mutex-protected reader admission to block
hardware accesses while reset work runs and wait for current users
before resetting.

Stop new reset requests during teardown and drain any queued or running
reset work before releasing the device resources.

This is the initial reset infrastructure only. It is not wired to a reset
source yet as those will follow in separate work.

Based on 'commit 53441a9cae3c ("drm/tyr: program CSF global interface")'
from tyr-for-upstream with the following patch series on the ML:
  - rust: add SRCU abstraction [1]
  - rust: workqueue: add cancel_sync support [2]

TODOs:
  - On reset failure, we don't do anything for now. We should unplug
    the GPU.
  - 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.

Changes since v5:
  - Use ScopedWork instead of a separately allocated Controller and its
    open-coded cancellation.
  - Rename reset-internal lifetimes.
  - use dev_dbg!() instead of dev_info!().
  - Use Danilo's workqueue series [2] which already includes OwnedQueue
    Send + Sync, ScopedQueue and ScopedWork.

Link: https://lore.kernel.org/all/20260613065348.96750-1-work@onurozkan.dev [1]
Link: https://lore.kernel.org/all/20260807165252.3849875-1-dakr@kernel.org [2]
Link: https://lore.kernel.org/all/20260708114358.957305-1-work@onurozkan.dev
Link: https://gitlab.freedesktop.org/panfrost/linux/-/issues/28
Signed-off-by: Onur Özkan <work@onurozkan.dev>
---
Onur Özkan (3):
      drm/tyr: clear stale IRQ state before soft reset
      drm/tyr: add GPU reset infrastructure
      drm/tyr: put iomem behind the hardware gate

 drivers/gpu/drm/tyr/driver.rs            |  65 ++++-----
 drivers/gpu/drm/tyr/fw.rs                |  16 +-
 drivers/gpu/drm/tyr/mmu.rs               |   9 +-
 drivers/gpu/drm/tyr/mmu/address_space.rs |  49 +++----
 drivers/gpu/drm/tyr/reset.rs             | 242 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/tyr/reset/hw_gate.rs     | 102 +++++++++++++
 drivers/gpu/drm/tyr/tyr.rs               |   1 +
 7 files changed, 406 insertions(+), 78 deletions(-)
---
base-commit: 53441a9cae3c4be552fa8aefa6e61b0f1bceb8a5
change-id: 20260813-tyr-reset-impl-93e951f996b4
prerequisite-message-id: <20260807165252.3849875-1-dakr@kernel.org>
prerequisite-patch-id: 4275f7d6e3cf96d61221d47f2398ebfb896db0c7
prerequisite-patch-id: f5e24f7b3717f2ab0445b5395c7f12b554861d78
prerequisite-patch-id: 0bf6ae4abcef7090d0e48921d6ec627a59dc6a7a
prerequisite-patch-id: 8dc24064e858240a6bb5411a261a987a7eae3fad
prerequisite-patch-id: eefbd4a72ed6da0083e20811882738cc3b05604f
prerequisite-patch-id: 7502236d334b13c547a8b47f0be9bf7171b5ca6b
prerequisite-message-id: <20260613065348.96750-1-work@onurozkan.dev>
prerequisite-patch-id: 9e1efee190d212ba1b01cd0acb5a4357e0b4da42
prerequisite-patch-id: 26aba035f4d1e212fa6ea7078095febefff5c5ba
prerequisite-patch-id: ffa25d5aadec4c04589af2bdd59a9c022f0fc9b0
prerequisite-patch-id: c2e05a4ac9d665d331952b291a622df6be673e41
prerequisite-patch-id: c14a4bd8a68b045356d61f7fa94690bd037ad08b

-- 

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

end of thread, other threads:[~2026-08-21 18:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 18:45 [PATCH v6 0/3] drm/tyr: GPU reset infrastructure Onur Özkan
2026-08-19 18:45 ` [PATCH v6 1/3] drm/tyr: clear stale IRQ state before soft reset Onur Özkan
2026-08-19 18:45 ` [PATCH v6 2/3] drm/tyr: add GPU reset infrastructure Onur Özkan
2026-08-21 15:31   ` Daniel Almeida
2026-08-21 15:58     ` Onur Özkan
2026-08-21 16:12       ` Danilo Krummrich
2026-08-21 16:39       ` Daniel Almeida
2026-08-21 16:42         ` Onur Özkan
2026-08-21 17:01         ` Danilo Krummrich
2026-08-21 17:23           ` Daniel Almeida
2026-08-21 18:53             ` Danilo Krummrich
2026-08-19 18:45 ` [PATCH v6 3/3] drm/tyr: put iomem behind the hardware gate Onur Özkan

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