AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>, <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 03/23] drm/amdgpu/gmc11: disallow gfxoff around TLB flushes
Date: Fri, 11 Sep 2026 13:55:24 -0400	[thread overview]
Message-ID: <20260911175544.1314467-4-alexander.deucher@amd.com> (raw)
In-Reply-To: <20260911175544.1314467-1-alexander.deucher@amd.com>

We need to disallow gfxoff if we touch GC MMIO registers.
At the moment we use MES for TLB flushes so no intended
functional change. This just protects the MMIO access if
the MES is not available.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
index bee269a8877a5..f7aae39f2d1b9 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
@@ -256,6 +256,10 @@ static void gmc_v11_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 	/* This path is needed before KIQ/MES/GFXOFF are set up */
 	hub_ip = (vmhub == AMDGPU_GFXHUB(0)) ? GC_HWIP : MMHUB_HWIP;
 
+	/* disabllow gfxoff when we invalidate */
+	if (hub_ip == GC_HWIP)
+		amdgpu_gfx_off_ctrl(adev, false);
+
 	spin_lock(&adev->gmc.invalidate_lock);
 	/*
 	 * It may lose gpuvm invalidate acknowldege state across power-gating
@@ -309,6 +313,9 @@ static void gmc_v11_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 
 	spin_unlock(&adev->gmc.invalidate_lock);
 
+	if (hub_ip == GC_HWIP)
+		amdgpu_gfx_off_ctrl(adev, true);
+
 	if (i >= adev->usec_timeout)
 		dev_err(adev->dev, "Timeout waiting for VM flush ACK!\n");
 }
-- 
2.55.0


  parent reply	other threads:[~2026-09-11 17:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 17:55 [PATCH V3 00/23] Rework GPU TLB invalidation Alex Deucher
2026-09-11 17:55 ` [PATCH 01/23] drm/amdgpu/gmc9: disallow gfxoff around TLB flushes Alex Deucher
2026-09-11 17:55 ` [PATCH 02/23] drm/amdgpu/gmc10: " Alex Deucher
2026-09-11 17:55 ` Alex Deucher [this message]
2026-09-11 17:55 ` [PATCH 04/23] drm/amdgpu/gmc12: " Alex Deucher
2026-09-11 17:55 ` [PATCH 05/23] drm/amdgpu/gmc9: set vmhub funcs for gfxhub and mmhub Alex Deucher
2026-09-11 17:55 ` [PATCH 06/23] drm/amdgpu: add a buffer funcs callback for TLB invalidation Alex Deucher
2026-09-11 17:55 ` [PATCH 07/23] drm/amdgpu/sdma5.0: add tlb invalidation buffer func callback Alex Deucher
2026-09-11 17:55 ` [PATCH 08/23] drm/amdgpu/sdma5.2: " Alex Deucher
2026-09-11 17:55 ` [PATCH 09/23] drm/amdgpu/sdma6: " Alex Deucher
2026-09-11 17:55 ` [PATCH 10/23] drm/amdgpu/sdma7: " Alex Deucher
2026-09-11 17:55 ` [PATCH 11/23] drm/amdgpu: add tlb invalidation method enum Alex Deucher
2026-09-11 17:55 ` [PATCH 12/23] drm/amdgpu: plumb tlb inv method in amdgpu_gmc_flush_gpu_tlb() Alex Deucher
2026-09-11 17:55 ` [PATCH 13/23] drm/amdgpu: uplevel reset check " Alex Deucher
2026-09-11 17:55 ` [PATCH 14/23] drm/amdgpu/gmc: add new callback to lookup vmid to pasid mapping Alex Deucher
2026-09-11 17:55 ` [PATCH 15/23] drm/amdgpu: add a gmc callback for the inv semaphore Alex Deucher
2026-09-11 17:55 ` [PATCH 16/23] drm/amdgpu/gmc: rework pasid flushing Alex Deucher
2026-09-11 17:55 ` [PATCH 17/23] drm/amdgpu/gmc: add helpers for various tlb inv functions Alex Deucher
2026-09-11 17:55 ` [PATCH 18/23] drm/amdgpu/gmc10: use SDMA for gart TLB invalidation Alex Deucher
2026-09-11 17:55 ` [PATCH 19/23] drm/amdgpu/gmc11: " Alex Deucher
2026-09-11 17:55 ` [PATCH 20/23] drm/amdgpu/gmc12: " Alex Deucher
2026-09-11 17:55 ` [PATCH 21/23] drm/amdgpu/gmc10: use SDMA for pasid " Alex Deucher
2026-09-11 17:55 ` [PATCH 22/23] drm/amdgpu/gmc11: " Alex Deucher
2026-09-11 17:55 ` [PATCH 23/23] drm/amdgpu/gmc12: use MES or " Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260911175544.1314467-4-alexander.deucher@amd.com \
    --to=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox