AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [RFC v3 4/4] drm/amdgpu: Use high priority scheduler workqueue for high priority rings
Date: Tue, 01 Dec 2026 15:56:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-243627@kernel.org> (raw)
In-Reply-To: <20261201154232.78320-5-tvrtko.ursulin@igalia.com>

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 <tvrtko.ursulin@igalia.com>

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);
>  
> +	if (ring->sched_wq)
> +		destroy_workqueue(ring->sched_wq);
> +
>  	for (i = 0; i <= 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().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201154232.78320-1-tvrtko.ursulin@igalia.com?part=4

      reply	other threads:[~2026-12-01 15:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 15:42 [RFC v3 0/4] Use high priority scheduler workqueue for high priority rings Tvrtko Ursulin
2026-12-01 15:42 ` [RFC v3 1/4] drm/amdgpu: Free trail_fence_offs when freeing rings Tvrtko Ursulin
2026-12-01 15:42 ` [RFC v3 2/4] drm/amdgpu: Cleanup on ring failure Tvrtko Ursulin
2026-12-01 16:02   ` sashiko-bot
2026-12-01 15:42 ` [RFC v3 3/4] drm/amdgpu: Unconfuse amdgpu_ring_init() Tvrtko Ursulin
2026-12-01 15:57   ` sashiko-bot
2026-12-01 15:42 ` [RFC v3 4/4] drm/amdgpu: Use high priority scheduler workqueue for high priority rings Tvrtko Ursulin
2026-12-01 15:56   ` sashiko-bot [this message]

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=sashiko-outbox-243627@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tvrtko.ursulin@igalia.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