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 9A9FF606A31A for ; Tue, 1 Dec 2026 15:56:13 +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=a2yDhFIW Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44E7C10E3E7; Tue, 1 Dec 2026 15:56:08 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB3E710E3E7 for ; Tue, 1 Dec 2026 15:56:02 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 104B160A4F; Tue, 1 Dec 2026 15:56:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BC3F1F000C1; Tue, 1 Dec 2026 15:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796140561; bh=wCjb4fA2fq9wemWjy8i/NabyJG7GKwxZj8SUiUz5OxA=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=a2yDhFIWezMPhMnkW2A6FIREz2qYKkPNz+hwApbtA2nW/FXo8TnNxp6xWGYyKRVH8 7FH2Wr8Byc4r9KHtgO5JBglcAI57dDQKJoSvJXaG2n772ueUdAEa/7a6CsCPjd+dpG 98hdq+HepB/NBlLjZAY3vsPAFgYCdZJtoIzWgekFteE4Gzj6yIRwUoBgRXLIGEWpdA mqCT7+cAnuxZwJkGa6JwA1MeO0g9TLg4Zkh1nOrOwnZWevNJ9NSp5S2L8uZfmPx1SX hyYPnAQQiI/zOb/JEJatns5+WE+qy9j9OFuL/2R0cVmq6fmxLogPmBZqjQoxbnTrGc qTfcPR8TJnEZA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC v3 4/4] drm/amdgpu: Use high priority scheduler workqueue for high priority rings To: "Tvrtko Ursulin" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261201154232.78320-5-tvrtko.ursulin@igalia.com> References: <20261201154232.78320-1-tvrtko.ursulin@igalia.com> <20261201154232.78320-5-tvrtko.ursulin@igalia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 15:56:00 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "amd-gfx" 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=ham 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: - [High] drm/amdgpu: double destroy of sched_wq in amdgpu_fence_driver_fini_ring() -- commit 92ab410b5813a4047dd4abb785b0ad07bf0b8f5d Author: Tvrtko Ursulin drm/amdgpu: Use high priority scheduler workqueue for high priority rings This commit allocates a dedicated ordered workqueue per ring for the DRM scheduler, setting WQ_HIGHPRI on high-priority rings, and destroys the workqueue in amdgpu_fence_driver_fini_ring(). > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/= amd/amdgpu/amdgpu_fence.c > index 1f1c28b200ffa..fe61895c561ce 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c > @@ -601,6 +601,9 @@ void amdgpu_fence_driver_fini_ring(struct amdgpu_ring= *ring) > if (ring->sched.ops) > drm_sched_fini(&ring->sched); > =20 > + if (ring->sched_wq) > + destroy_workqueue(ring->sched_wq); > + > for (i =3D 0; i <=3D ring->fence_drv.num_fences_mask; ++i) > dma_fence_put(ring->fence_drv.fences[i]); > kfree(ring->fence_drv.fences); [Severity: High] Can destroy_workqueue(ring->sched_wq) be called twice on the same ring during device teardown? amdgpu_device_fini_sw() runs amdgpu_device_ip_fini(), where each IP block's sw_fini calls amdgpu_ring_fini() -> amdgpu_fence_driver_fini_ring(ring), and then calls amdgpu_fence_driver_sw_fini(), which iterates over adev->rings[] and calls amdgpu_fence_driver_fini_ring() a second time. Because ring->sched_wq is not cleared (and amdgpu_fence_driver_fini_ring() is not guarded against running twice), the second call passes the already-freed ring->sched_wq to destroy_workqueue(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201154232.7832= 0-1-tvrtko.ursulin@igalia.com?part=3D4