All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] drm/amdgpu: capture more of the hang state in the devcoredump
@ 2026-12-02 22:36 Matt Turner
  2026-12-02 22:36 ` [PATCH 01/14] drm/amdgpu: dump the IP state of each device in an XGMI hive Matt Turner
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Matt Turner @ 2026-12-02 22:36 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Sunil Khatri,
	Trigger Huang
  Cc: amd-gfx, dri-devel, linux-kernel, Matt Turner, Gregoire Pean

The amdgpu devcoredump often doesn't have enough in it to tell why a
job hung, and some of what it has describes the wrong moment. The IB
contents are read from the coredump worker, which runs concurrently
with recovery, so by then the process may have been killed or VRAM
lost, and a later hang or fault can replace the IP registers and the
VM fault info before the dump is formatted. Nothing in the dump shows
which part of a ring belongs to which submission, which BO an address
belongs to, or what the memory the IBs point at contained. When a dump
is dropped, nothing says so.

Patches 1 to 5 fix dumps that describe the wrong state or are missing.
An XGMI hive dumped only the requesting device, and dumped it again
after suspending it, and every device in the hive was given the hung
job. A second hang could overwrite the IP registers while the first
dump was being formatted. Resets done by a reset handler produced no
coredump. The VM fault info was read when the dump was formatted rather
than when the hang was detected.

Patch 6 adds CP_STAT to the gfx10, gfx11 and gfx12 IP dumps, and the
IB2 progress registers to the per gfx queue dumps of gfx11 and gfx12.

Patches 7 and 8 copy the IB contents before formatting, and then from
the job timeout handler itself, before soft recovery or a reset can
change them. That path is a dma_fence signaling critical section, so
everything there is trylocked, allocated with GFP_NOWAIT and read
without the slow MMIO path for CPU invisible VRAM, and at most 8 MiB is
copied there so as not to hold up recovery. What can't be copied is
retried from the worker and marked as such.

Patches 9 to 12 add the submitting thread of the hung job, the
unsignaled fences of each ring, a count of dropped dumps, and the VM
mappings of the hung job.

Patch 13 adds AMDGPU_VM_PAGE_DUMP, a mapping flag with which userspace
asks for the contents of a mapping to be included in the coredump,
subject to size limits. The RADV side is
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/47015.

Patch 14 bumps the coredump version, since the format has changed.

This series depends on "drm/amdgpu: fix IB content read in the
devcoredump" from the "drm/amdgpu: devcoredump and reset fixes"
series, and not on the other patches there.

Signed-off-by: Matt Turner <mattst88@gmail.com>
---
Matt Turner (14):
      drm/amdgpu: dump the IP state of each device in an XGMI hive
      drm/amdgpu: only give the hung job to its own device's coredump
      drm/amdgpu: don't overwrite the IP state while a coredump is formatted
      drm/amdgpu: take a coredump before resets done by a reset handler
      drm/amdgpu: copy the VM fault info when the hang is detected
      drm/amdgpu/gfx10-12: dump CP_STAT and the IB2 state of each gfx queue
      drm/amdgpu: copy the IB contents before formatting the devcoredump
      drm/amdgpu: copy the IB contents when the hang is detected
      drm/amdgpu: record the submitting thread of the hung job in the coredump
      drm/amdgpu: dump the unsignaled fences of each ring in the coredump
      drm/amdgpu: report dropped devcoredumps
      drm/amdgpu: list the VM mappings of the hung job in the coredump
      drm/amdgpu: add AMDGPU_VM_PAGE_DUMP to include BOs in the coredump
      drm/amdgpu: bump the devcoredump version

 drivers/gpu/drm/amd/amdgpu/amdgpu.h              |   6 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c           |   5 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 980 ++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h |  74 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c       |  31 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c          |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c          |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c           |   9 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c          |  12 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.h          |   6 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c        |  40 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h        |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c           |  57 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h           |   5 +
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c           |   1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c           |   5 +
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c           |   5 +
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c           |   1 +
 include/uapi/drm/amdgpu_drm.h                    |   6 +
 19 files changed, 1096 insertions(+), 155 deletions(-)
---
base-commit: 83558fcf83cc911e09962ea17c883add596766c0
change-id: 20261118-amdgpu-devcoredump-fd7a93c870e1
prerequisite-patch-id: f4f8e95c172ec46bce86f4a08b00117c7e8edd73

Best regards,
--  
Matt Turner <mattst88@gmail.com>


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

end of thread, other threads:[~2026-12-02 22:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 22:36 [PATCH 00/14] drm/amdgpu: capture more of the hang state in the devcoredump Matt Turner
2026-12-02 22:36 ` [PATCH 01/14] drm/amdgpu: dump the IP state of each device in an XGMI hive Matt Turner
2026-12-02 22:36 ` [PATCH 02/14] drm/amdgpu: only give the hung job to its own device's coredump Matt Turner
2026-12-02 22:36 ` [PATCH 03/14] drm/amdgpu: don't overwrite the IP state while a coredump is formatted Matt Turner
2026-12-02 22:36 ` [PATCH 04/14] drm/amdgpu: take a coredump before resets done by a reset handler Matt Turner
2026-12-02 22:36 ` [PATCH 05/14] drm/amdgpu: copy the VM fault info when the hang is detected Matt Turner
2026-12-02 22:36 ` [PATCH 06/14] drm/amdgpu/gfx10-12: dump CP_STAT and the IB2 state of each gfx queue Matt Turner
2026-12-02 22:36 ` [PATCH 07/14] drm/amdgpu: copy the IB contents before formatting the devcoredump Matt Turner
2026-12-02 22:36 ` [PATCH 08/14] drm/amdgpu: copy the IB contents when the hang is detected Matt Turner
2026-12-02 22:36 ` [PATCH 09/14] drm/amdgpu: record the submitting thread of the hung job in the coredump Matt Turner
2026-12-02 22:36 ` [PATCH 10/14] drm/amdgpu: dump the unsignaled fences of each ring " Matt Turner
2026-12-02 22:36 ` [PATCH 11/14] drm/amdgpu: report dropped devcoredumps Matt Turner
2026-12-02 22:36 ` [PATCH 12/14] drm/amdgpu: list the VM mappings of the hung job in the coredump Matt Turner
2026-12-02 22:36 ` [PATCH 13/14] drm/amdgpu: add AMDGPU_VM_PAGE_DUMP to include BOs " Matt Turner
2026-12-02 22:36 ` [PATCH 14/14] drm/amdgpu: bump the devcoredump version Matt Turner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.