summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Cornwall <jay.cornwall@amd.com>2025-06-11 09:52:14 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-06 10:58:02 +0200
commit0f9d342da213fc6febab18539f93a55fd6417a31 (patch)
treea5eda4c0b66c7ca1b91ff500886ecfc858538cf6
parentae2015b0dbc0eea7aaf022194371f451f784d994 (diff)
downloadlinux-0f9d342da213fc6febab18539f93a55fd6417a31.tar.gz
linux-0f9d342da213fc6febab18539f93a55fd6417a31.tar.bz2
linux-0f9d342da213fc6febab18539f93a55fd6417a31.zip
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>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
index 18250845a989..f335624c2d77 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
@@ -201,7 +201,7 @@ static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
packet->bitfields2.engine_sel =
engine_sel__mes_map_queues__compute_vi;
- packet->bitfields2.gws_control_queue = q->gws ? 1 : 0;
+ packet->bitfields2.gws_control_queue = q->properties.is_gws ? 1 : 0;
packet->bitfields2.extended_engine_sel =
extended_engine_sel__mes_map_queues__legacy_engine_sel;
packet->bitfields2.queue_type =