From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A37B606A32C for ; Wed, 2 Dec 2026 22:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V4w8TcHe Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A5121125BD; Wed, 2 Dec 2026 22:48:17 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EF2010E6BA; Wed, 2 Dec 2026 22:48:10 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 55E7445511; Wed, 2 Dec 2026 22:48:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C66A1F00893; Wed, 2 Dec 2026 22:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796251689; bh=Vlds3Mt++2uS8gl4AqV76SKy5C4+qxM5dUVaD2xmZD8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=V4w8TcHefsGKUCVEeP36/oUJ+PigBBfKBH7BPRtgKZm56DmJhO50sBr+S82Prjmfw H7dlv/ZCePMqULyWvLEWjnQH6WiaJeGx/lIImI3PSvFXbOTA8edJmPqWezIMReICa4 c/3ISM2o8QDZxuvuQcvVBni7fy+ICRpiG8EmBeKtE+fk/eyagIodyrNkt1B4+4C3Ro RdfjWOFRONJgkjwGEaDFHgED3D5BacrgSKZzQHx4Oqt/IrZNo/ZH56QW9kHCkJ8bVW NM6NGuvyp+/to4FH8JvzU6ckmOPseAFAz0xXITypPFSlB8c9MbE04bofml1w9fcL84 iLjxLK4MPwYIg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset To: "Matt Turner" Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org In-Reply-To: <20261202-amdgpu-devcoredump-fixes-v1-3-59f622a29769@gmail.com> References: <20261202-amdgpu-devcoredump-fixes-v1-0-59f622a29769@gmail.com> <20261202-amdgpu-devcoredump-fixes-v1-3-59f622a29769@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 22:48:09 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/amdgpu: amdgpu_gfx_disable_kgq() skips post-reset unmap on GFX11 -- commit 0c68dfc74c61f610dfe69cfef805b4a5d17edd1f Author: Matt Turner drm/amdgpu: don't unmap legacy queues through MES during reset This commit skips the MES legacy queue unmap in amdgpu_gfx_disable_kcq() and amdgpu_gfx_disable_kgq() when a GPU reset is in progress. > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_gfx.c > index c5a2dcff5058a..0e9456b57577b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c [ ... ] > @@ -636,6 +640,10 @@ int amdgpu_gfx_disable_kgq(struct amdgpu_device *ade= v, int xcc_id) > int j; > =20 > if (adev->enable_mes) { > + /* As below for KIQ: the reset tears down and rebuilds the queues. */ > + if (amdgpu_in_reset(adev)) > + return 0; > + > if (amdgpu_gfx_is_master_xcc(adev, xcc_id)) { > for (i =3D 0; i < adev->gfx.num_gfx_rings; i++) { > j =3D i + xcc_id * adev->gfx.num_gfx_rings; [Severity: Medium] Does returning early when amdgpu_in_reset(adev) is true prevent gfx_v11_0_cp_resume() from unmapping the temporary gfx_ring[0] during post-reset resume when adev->gfx.disable_kq is set? During GPU recovery, amdgpu_device_gpu_recover() holds the reset domain lock (keeping in_gpu_reset set to 1) across amdgpu_device_asic_reset(), including post-reset IP reinitialization in amdgpu_device_reinit_after_reset() -> ... -> gfx_v11_0_cp_resume(). When adev->gfx.disable_kq is true, gfx_v11_0_cp_resume() temporarily maps gfx_ring[0] via amdgpu_gfx_enable_kgq() to initialize clear state and then immediately calls amdgpu_gfx_disable_kgq(adev, 0) to unmap it: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:gfx_v11_0_cp_resume() { ... if (adev->gfx.disable_kq) { for (i =3D 0; i < adev->gfx.num_gfx_rings; i++) { ring =3D &adev->gfx.gfx_ring[i]; /* we don't want to set ring->ready */ r =3D amdgpu_ring_test_ring(ring); if (r) return r; } amdgpu_gfx_disable_kgq(adev, 0); } ... } Because amdgpu_in_reset(adev) is still true at that point, amdgpu_gfx_disable_kgq() now returns early without calling amdgpu_mes_unmap_legacy_queue(). That leaves gfx_ring[0] mapped on an HQD that amdgpu_mes_init() did not reserve for kernel queues and instead exposed in adev->mes.gfx_hqd_mask for MES user queues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-amdgpu-dev= coredump-fixes-v1-0-59f622a29769@gmail.com?part=3D3