All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Berliner <caberliner@gmail.com>
To: amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, christian.koenig@amd.com,
	Jiqian.Chen@amd.com, Christoph Berliner <caberliner@gmail.com>
Subject: [PATCH 0/2] drm/amdgpu/gfx9: make KFD usable again after MODE2 on Renoir
Date: Fri, 20 Nov 2026 18:24:05 +0100	[thread overview]
Message-ID: <20261120172407.64651-1-caberliner@gmail.com> (raw)

On Renoir/Cezanne (GC 9.3.0) a MODE2 reset reports success, graphics and
the kernel compute queues come back, but KFD stays dead until reboot:
every new KFD queue runs into "qcm fence wait loop timeout expired"
and triggers the next reset. Reported in
https://gitlab.freedesktop.org/drm/amd/-/issues/6177, sent here as
asked there.

Commit c3988a7ad479 ("drm/amdgpu/gfx9: Fix Ring and IB test fail after
mode2") already found that MODE2 does not reset the HQD registers on
gfx9 APUs and deactivates the KCQ HQDs before the reset. The HIQ used by
KFD survives as well, though: kq_uninitialize() skips destroy_mqd()
during a reset because it cannot take the reset domain semaphore. After
MODE2 the MEC restarts with the stale HIQ and the HWS no longer answers.
The same trylock pattern on the MES side is discussed in
https://gitlab.freedesktop.org/drm/amd/-/issues/6053.

Patch 1 is a small cleanup plus a fix for the timeout check of the
existing dequeue loop. Patch 2 deactivates all active compute HQDs
(except the KIQ) before MODE2, restricted to GC 9.3.0 because that is
the only gfx9 APU I could test. Raven/Picasso likely need the same, but
I don't know this code well enough to widen the condition without
hardware to test on.

Tested on a Ryzen 5 5600G (gfx90c), MEC firmware 0x1e3, HWS,
amdgpu.noretry=1. An instrumented build used the old path for the first
MODE2 and the new path for later ones, so both were compared in the
same boot:

  old path: HIQ still ACTIVE with the old MQD/PQ after MODE2; next HIP
            program -> "qcm fence wait loop timeout", GPU hang, reset
  new path: only the KIQ active at resume, HIP/rocBLAS tests pass

Since then the patches run as the boot-time amdgpu module on the
Proxmox 7.0.14 kernels (-29 and now -30): requested reset with 9 HQDs
deactivated and the KIQ skipped, HIP/rocBLAS work before and after.
On amd-staging-drm-next (8dd68a795) the series applies with offsets
and builds without warnings (W=1).

The analysis and the patches were prepared with an AI coding assistant
(see the Assisted-by tags); I tested them on the hardware described
above.

Christoph Berliner (2):
  drm/amdgpu/gfx9: factor out HQD deactivation and fix its timeout check
  drm/amdgpu/gfx9: deactivate all compute HQDs before MODE2 on Renoir

 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 105 ++++++++++++++++++++------
 1 file changed, 82 insertions(+), 23 deletions(-)

-- 
2.56.1


             reply	other threads:[~2026-11-20 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 17:24 Christoph Berliner [this message]
2026-11-20 17:24 ` [PATCH 1/2] drm/amdgpu/gfx9: factor out HQD deactivation and fix its timeout check Christoph Berliner
2026-11-20 17:24 ` [PATCH 2/2] drm/amdgpu/gfx9: deactivate all compute HQDs before MODE2 on Renoir Christoph Berliner
2026-11-20 19:25 ` [PATCH 0/2] drm/amdgpu/gfx9: make KFD usable again after " 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=20261120172407.64651-1-caberliner@gmail.com \
    --to=caberliner@gmail.com \
    --cc=Jiqian.Chen@amd.com \
    --cc=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 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.