From d88ec097cf1a55c459e1316b0d82b6aa111724b8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 24 Feb 2025 15:13:59 +0100 Subject: [PATCH] 6.13-stable patches added patches: drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch --- ...-bump-version-for-rv-pco-compute-fix.patch | 35 ++++++++ ...manually-control-gfxoff-for-cs-on-rv.patch | 86 +++++++++++++++++++ queue-6.13/series | 2 + 3 files changed, 123 insertions(+) create mode 100644 queue-6.13/drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch create mode 100644 queue-6.13/drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch diff --git a/queue-6.13/drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch b/queue-6.13/drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch new file mode 100644 index 0000000000..cf9b200f06 --- /dev/null +++ b/queue-6.13/drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch @@ -0,0 +1,35 @@ +From 55ed2b1b50d029dd7e49a35f6628ca64db6d75d8 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Fri, 31 Jan 2025 13:53:40 -0500 +Subject: drm/amdgpu: bump version for RV/PCO compute fix + +From: Alex Deucher + +commit 55ed2b1b50d029dd7e49a35f6628ca64db6d75d8 upstream. + +Bump the driver version for RV/PCO compute stability fix +so mesa can use this check to enable compute queues on +RV/PCO. + +Reviewed-by: Lijo Lazar +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 6.12.x +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -120,9 +120,10 @@ + * - 3.58.0 - Add GFX12 DCC support + * - 3.59.0 - Cleared VRAM + * - 3.60.0 - Add AMDGPU_TILING_GFX12_DCC_WRITE_COMPRESS_DISABLE (Vulkan requirement) ++ * - 3.61.0 - Contains fix for RV/PCO compute queues + */ + #define KMS_DRIVER_MAJOR 3 +-#define KMS_DRIVER_MINOR 60 ++#define KMS_DRIVER_MINOR 61 + #define KMS_DRIVER_PATCHLEVEL 0 + + /* diff --git a/queue-6.13/drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch b/queue-6.13/drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch new file mode 100644 index 0000000000..32aee8020c --- /dev/null +++ b/queue-6.13/drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch @@ -0,0 +1,86 @@ +From b35eb9128ebeec534eed1cefd6b9b1b7282cf5ba Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Tue, 28 Jan 2025 11:55:22 -0500 +Subject: drm/amdgpu/gfx9: manually control gfxoff for CS on RV +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alex Deucher + +commit b35eb9128ebeec534eed1cefd6b9b1b7282cf5ba upstream. + +When mesa started using compute queues more often +we started seeing additional hangs with compute queues. +Disabling gfxoff seems to mitigate that. Manually +control gfxoff and gfx pg with command submissions to avoid +any issues related to gfxoff. KFD already does the same +thing for these chips. + +v2: limit to compute +v3: limit to APUs +v4: limit to Raven/PCO +v5: only update the compute ring_funcs +v6: Disable GFX PG +v7: adjust order + +Reviewed-by: Lijo Lazar +Suggested-by: Błażej Szczygieł +Suggested-by: Sergey Kovalenko +Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3861 +Link: https://lists.freedesktop.org/archives/amd-gfx/2025-January/119116.html +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 6.12.x +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +@@ -7439,6 +7439,34 @@ static void gfx_v9_0_ring_emit_cleaner_s + amdgpu_ring_write(ring, 0); /* RESERVED field, programmed to zero */ + } + ++static void gfx_v9_0_ring_begin_use_compute(struct amdgpu_ring *ring) ++{ ++ struct amdgpu_device *adev = ring->adev; ++ ++ amdgpu_gfx_enforce_isolation_ring_begin_use(ring); ++ ++ /* Raven and PCO APUs seem to have stability issues ++ * with compute and gfxoff and gfx pg. Disable gfx pg during ++ * submission and allow again afterwards. ++ */ ++ if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0)) ++ gfx_v9_0_set_powergating_state(adev, AMD_PG_STATE_UNGATE); ++} ++ ++static void gfx_v9_0_ring_end_use_compute(struct amdgpu_ring *ring) ++{ ++ struct amdgpu_device *adev = ring->adev; ++ ++ /* Raven and PCO APUs seem to have stability issues ++ * with compute and gfxoff and gfx pg. Disable gfx pg during ++ * submission and allow again afterwards. ++ */ ++ if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0)) ++ gfx_v9_0_set_powergating_state(adev, AMD_PG_STATE_GATE); ++ ++ amdgpu_gfx_enforce_isolation_ring_end_use(ring); ++} ++ + static const struct amd_ip_funcs gfx_v9_0_ip_funcs = { + .name = "gfx_v9_0", + .early_init = gfx_v9_0_early_init, +@@ -7615,8 +7643,8 @@ static const struct amdgpu_ring_funcs gf + .emit_wave_limit = gfx_v9_0_emit_wave_limit, + .reset = gfx_v9_0_reset_kcq, + .emit_cleaner_shader = gfx_v9_0_ring_emit_cleaner_shader, +- .begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use, +- .end_use = amdgpu_gfx_enforce_isolation_ring_end_use, ++ .begin_use = gfx_v9_0_ring_begin_use_compute, ++ .end_use = gfx_v9_0_ring_end_use_compute, + }; + + static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = { diff --git a/queue-6.13/series b/queue-6.13/series index 7d4f8e7ba3..18d10d110b 100644 --- a/queue-6.13/series +++ b/queue-6.13/series @@ -134,3 +134,5 @@ ftrace-do-not-add-duplicate-entries-in-subops-manager-ops.patch drm-select-drm_kms_helper-from-drm_gem_shmem_helper.patch tracing-fix-using-ret-variable-in-tracing_set_tracer.patch net-pse-pd-fix-deadlock-in-current-limit-functions.patch +drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch +drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch -- 2.47.3