]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdkfd: Fix race in GWS queue scheduling
authorJay Cornwall <jay.cornwall@amd.com>
Wed, 11 Jun 2025 14:52:14 +0000 (09:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 13:57:40 +0000 (15:57 +0200)
commit105b0a0c7e651dd2c7bd334ca804780dc24683f1
tree558eba96a126e19917852d13dbb337fe6c4a1ff4
parentb0dc5d6da1da4806e8aa987fcbf4769b38eca1fa
drm/amdkfd: Fix race in GWS queue scheduling

commit cfb05257ae168a0496c7637e1d9e3ab8a25cbffe upstream.

q->gws is not updated atomically with qpd->mapped_gws_queue. If a
runlist is created between pqm_set_gws and update_queue it will
contain a queue which uses GWS in a process with no GWS allocated.
This will result in a scheduler hang.

Use q->properties.is_gws which is changed while holding the DQM lock.

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b98370220eb3110e82248e3354e16a489a492cfb)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c