The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/4] accel/rocket: Fix teardown with a job on the NPU
@ 2026-12-04  6:35 Arun Iyengar via B4 Relay
  2026-12-04  6:35 ` [PATCH v2 1/4] accel/rocket: Wait for in-flight jobs before releasing the file's BOs Arun Iyengar via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arun Iyengar via B4 Relay @ 2026-12-04  6:35 UTC (permalink / raw)
  To: Tomeu Vizoso, Oded Gabbay
  Cc: Heiko Stuebner, Jeff Hugo, Sumit Semwal, Christian König,
	Philipp Stanner, Midgy BALON, Jiaxing Hu, dri-devel,
	linux-rockchip, linux-kernel, linux-media, linaro-mm-sig, stable,
	Arun Iyengar

Four fixes for teardown with a job on the NPU: at file close, in the
timeout reset and at core unbind.

1: wait for the file's jobs before its BOs are released.
2: reset the core before detaching its IOMMU (same change as Midgy
   Balon's RK3568 RFC, linked in the patch).
3: stop the scheduler before releasing the IOMMU group.
4: reset the core at unbind, which also cancels the job on the NPU.

Tested on an Orange Pi 5 (RK3588), 7.3, KASAN. Patches 1-2: 70 SIGKILLs
during inference, no job timeout (before: 12 in 10 kills); 10 faulting
jobs, no IOMMU stall timeout or warning (before: 75 and 10), also with
the next-20261127 rockchip-iommu.c. Patch 3: core unbound while its
timeout handler ran (forced by a test delay): no oops, core rebound,
inference unchanged (before: NULL dereference in iommu_detach_group()).
Patch 4: core unbound with a job running (5 runs), with a hung job (5)
and idle (3): no oops, file close returns, core rebound, inference
unchanged (before: file close hangs on a hung job; the NULL detach from
the interrupt handler follows from the code, I could not trigger it).

Not fixed: a file that stays open across a core unbind keeps a
scheduler entity on the torn-down scheduler (freed run queue, queued
jobs never run). That needs the entity lifetime reworked.

Developed with Claude (Anthropic), which wrote the code and the commit
messages.

Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
Changes in v2:
- New patch 3: stop the scheduler before releasing the IOMMU group
  (Sashiko).
- New patch 4: reset the core at unbind.
- Patch 1: drop a comment that repeated the commit message.
- Patch 2 unchanged.
- Link to v1: https://patch.msgid.link/20261201-rocket-fixes-v1-0-986c3e5ceb44@gmail.com

---
Arun Iyengar (4):
      accel/rocket: Wait for in-flight jobs before releasing the file's BOs
      accel/rocket: Reset the core before detaching its IOMMU
      accel/rocket: Stop the scheduler before releasing the IOMMU group
      accel/rocket: Reset the core at unbind

 drivers/accel/rocket/rocket_core.c |  2 +-
 drivers/accel/rocket/rocket_core.h |  2 ++
 drivers/accel/rocket/rocket_drv.c  | 24 ++++++++++++++++++++++--
 drivers/accel/rocket/rocket_drv.h  |  2 ++
 drivers/accel/rocket/rocket_job.c  | 37 +++++++++++++++++++++++++++++++------
 5 files changed, 58 insertions(+), 9 deletions(-)
---
base-commit: 502ea48d0d8fa5dd0c31dc449efb3d82deef8efe
change-id: 20261130-rocket-fixes-e1438ca23bee

Best regards,
--  
Arun Iyengar <aiyengar1990@gmail.com>



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

end of thread, other threads:[~2026-12-04  6:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  6:35 [PATCH v2 0/4] accel/rocket: Fix teardown with a job on the NPU Arun Iyengar via B4 Relay
2026-12-04  6:35 ` [PATCH v2 1/4] accel/rocket: Wait for in-flight jobs before releasing the file's BOs Arun Iyengar via B4 Relay
2026-12-04  6:35 ` [PATCH v2 2/4] accel/rocket: Reset the core before detaching its IOMMU Arun Iyengar via B4 Relay
2026-12-04  6:35 ` [PATCH v2 3/4] accel/rocket: Stop the scheduler before releasing the IOMMU group Arun Iyengar via B4 Relay
2026-12-04  6:35 ` [PATCH v2 4/4] accel/rocket: Reset the core at unbind Arun Iyengar via B4 Relay

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