Skip to content

Commit cfb0525

Browse files
jcornwallAMDalexdeucher
authored andcommitted
drm/amdkfd: Fix race in GWS queue scheduling
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]
1 parent 49cc5be commit cfb0525

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
@@ -240,7 +240,7 @@ static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
240240

241241
packet->bitfields2.engine_sel =
242242
engine_sel__mes_map_queues__compute_vi;
243-
packet->bitfields2.gws_control_queue = q->gws ? 1 : 0;
243+
packet->bitfields2.gws_control_queue = q->properties.is_gws ? 1 : 0;
244244
packet->bitfields2.extended_engine_sel =
245245
extended_engine_sel__mes_map_queues__legacy_engine_sel;
246246
packet->bitfields2.queue_type =

0 commit comments

Comments
 (0)