Skip to content

Commit 515140d

Browse files
jcornwallAMDSasha Levin
authored andcommitted
drm/amdkfd: Fix race in GWS queue scheduling
commit cfb0525 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 <[email protected]> Reviewed-by: Harish Kasiviswanathan <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit b983702) Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fe56d43 commit 515140d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
201201

202202
packet->bitfields2.engine_sel =
203203
engine_sel__mes_map_queues__compute_vi;
204-
packet->bitfields2.gws_control_queue = q->gws ? 1 : 0;
204+
packet->bitfields2.gws_control_queue = q->properties.is_gws ? 1 : 0;
205205
packet->bitfields2.extended_engine_sel =
206206
extended_engine_sel__mes_map_queues__legacy_engine_sel;
207207
packet->bitfields2.queue_type =

0 commit comments

Comments
 (0)