Skip to content

drm/amdgpu: Rework IP block soft reset on GFX8

Timur Kristóf amd-gfx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17drm/amdgpu: Clarify name of soft recovery to avoid confusiondrivers/gpu/drm/amd/amdgpu/amdgpu.h drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 more+6 -61 reply
2/17drm/amdgpu: Clean up defunct soft reset from ASIC reset code pathdrivers/gpu/drm/amd/amdgpu/amdgpu.h drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/cik.c +7 more+2 -2581 reply
3/17drm/amdgpu: Delete GMC 8 soft resetdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c+0 -1261 reply
4/17drm/amdgpu: Delete soft reset code from legacy display driverdrivers/gpu/drm/amd/amdgpu/dce_v10_0.c drivers/gpu/drm/amd/amdgpu/dce_v6_0.c drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+0 -1801 reply
5/17drm/amdgpu: Delete check_soft_reset() from amd_ip_funcsdrivers/gpu/drm/amd/amdgpu/gfx_v11_0.c drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c +13 more+0 -2581 reply
6/17drm/amdgpu: Delete pre/post_soft_reset() from amd_ip_funcsdrivers/gpu/drm/amd/amdgpu/gfx_v11_0.c drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c +8 more+15 -2131 reply
7/17drm/amdgpu: don't reemit if there is nothing to reemitdrivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+10 -00 replies
8/17drm/amdgpu: track guilty fence for queue resetdrivers/gpu/drm/amd/amdgpu/amdgpu_fence.c drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h+12 -00 replies
9/17drm/amdgpu/fence: add helper to extract the guilty fence (v2)drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h+32 -00 replies
10/17drm/amdgpu: amdgpu_ring_set_fence_errors_and_reemit() handle NULL fencedrivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+2 -10 replies
11/17drm/amdgpu: Add IP block soft reset as a GPU recovery methoddrivers/gpu/drm/amd/amdgpu/amdgpu.h drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c +4 more+355 -10 replies
12/17drm/amdgpu/gfx8: Stop CP and RLC during resetdrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+5 -70 replies
13/17drm/amdgpu/gfx8: Return error when testing all ringsdrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+4 -20 replies
14/17drm/amdgpu/gfx8: Support COND_EXEC on compute ringsdrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+3 -00 replies
15/17drm/amdgpu/gfx8: Adjust EDC GPR workarounddrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+8 -10 replies
16/17drm/amdgpu/gfx8: Fixup IP block soft resetdrivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+34 -110 replies
17/17drm/amdgpu/gfx8: Enable IP block soft reset as a GPU recovery methoddrivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+5 -00 replies

Reviews trailers per patch

10 of 17 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTimur KristófChristian KönigAlex DeucherMartin Roukala
SeriesR-b T-b
1/17R-b
2/17R-b
3/17A-b
4/17R-b
5/17R-b
6/17A-b
7/17R-b
8/17R-b
9/17R-b
10/17R-b
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/17] drm/amdgpu: Rework IP block soft reset on GFX8

IP block soft reset is a way to reset just one IP block in a GPU without resetting the whole GPU or losing the contents of VRAM. Currently this is implemented for various IP blocks, but actually only used on Carrizo and Stoney as part of the ASIC reset code, and it fails.

Let's rework that.

Delete the defunct code from the ASIC reset code path. Also delete check_soft_reset() and pre/post_soft_reset() which were quite useless and redundant (see the commit messages for details).

Add IP block soft reset as a GPU recovery method instead. This works similarly to ring reset, but will affect all rings that belong to the IP block. For example, a GFX IP block soft reset will affect all graphics and compute rings. It is called when a job is timed out. Attempt to minimize the effect on non-guilty jobs, then back up the contents of all affected rings, perform the HW specific soft reset, then restore the rings.
For this, I am also including some patches from Alex which were written for pipe reset and solve some problems also for IP block soft reset.

Finally, let's fix up the soft reset implementation on GFX8 to make sure it works on every GFX8 chip. Specifically, fix an issue with compute rings hanging after the reset, and fix an issue with increased power consumption after the reset, among others. With those issues gone, enable the new GPU recovery method on GFX8.

Tested with the "hard_reset_cp_wait" test case from the Hang Test Suite created by Natalie Vock and Konstantin Seurer. This Vulkan testcase waits for an event that never occurs, effectively a WAIT_REG_MEM packet that intentionally hangs. IP block soft reset can resolve that hang and allow the rest of the system to move on and keep functioning without needing a full ASIC reset.

Tested on the following chips:

Polaris 10 (Radeon RX 570)
Polaris 11 (Radeon RX 560)
Polaris 12 (Radeon RX 550)
Fiji (Radeon R9 Nano)
Tonga (Radeon R9 380X)
Carrizo (A8-9600)

Alex Deucher (4):
drm/amdgpu: don't reemit if there is nothing to reemit drm/amdgpu: track guilty fence for queue reset drm/amdgpu/fence: add helper to extract the guilty fence (v2) drm/amdgpu: amdgpu_ring_set_fence_errors_and_reemit() handle NULL
fence

Timur Kristóf (13):
drm/amdgpu: Clarify name of soft recovery to avoid confusion drm/amdgpu: Clean up defunct soft reset from ASIC reset code path drm/amdgpu: Delete GMC 8 soft reset
drm/amdgpu: Delete soft reset code from legacy display driver drm/amdgpu: Delete check_soft_reset() from amd_ip_funcs drm/amdgpu: Delete pre/post_soft_reset() from amd_ip_funcs drm/amdgpu: Add IP block soft reset as a GPU recovery method drm/amdgpu/gfx8: Stop CP and RLC during reset drm/amdgpu/gfx8: Return error when testing all rings drm/amdgpu/gfx8: Support COND_EXEC on compute rings drm/amdgpu/gfx8: Adjust EDC GPR workaround drm/amdgpu/gfx8: Fixup IP block soft reset drm/amdgpu/gfx8: Enable IP block soft reset as a GPU recovery method

 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |   7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 179 +-------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  10 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |  54 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h       |   2 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h       |   1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c        | 154 ++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ip.h        |   5 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |  13 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c      | 171 +++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h      |   8 +
 drivers/gpu/drm/amd/amdgpu/cik.c              |   7 -
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |  66 ------
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |  57 -----
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |  57 -----
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c        |  36 +--
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c         | 224 +++++-------------
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c         | 125 ----------
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c      |   3 -
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_2.c      |   3 -
 drivers/gpu/drm/amd/amdgpu/nv.c               |   6 -
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c        |  62 -----
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c        |  18 --
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c        |  18 --
 drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c        |  18 --
 drivers/gpu/drm/amd/amdgpu/si.c               |   7 -
 drivers/gpu/drm/amd/amdgpu/soc15.c            |   9 -
 drivers/gpu/drm/amd/amdgpu/soc21.c            |  12 -
 drivers/gpu/drm/amd/amdgpu/soc24.c            |  11 -
 drivers/gpu/drm/amd/amdgpu/soc_v1_0.c         |  10 -
 drivers/gpu/drm/amd/amdgpu/tonga_ih.c         |  40 ----
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c         |  45 ----
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c         |  69 ------
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c       |   3 -
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_2.c       |   3 -
 drivers/gpu/drm/amd/amdgpu/vi.c               |  22 --
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   6 -
 drivers/gpu/drm/amd/include/amd_shared.h      |   3 -
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c     |   1 -
 39 files changed, 487 insertions(+), 1058 deletions(-)
Signature · 1 line
2.54.0