Skip to content

Commit c557fd1

Browse files
jnar17jlahtine-intel
authored andcommitted
drm/i915/guc: Check if expecting reply before decrementing outstanding_submission_g2h
When sending a H2G message where a reply is expected in guc_submission_send_busy_loop(), outstanding_submission_g2h is incremented before the send. However, if there is an error sending the message, outstanding_submission_g2h is decremented without checking if a reply is expected. Therefore, check if reply is expected when there is a failure before decrementing outstanding_submission_g2h. Fixes: 2f2cc53 ("drm/i915/guc: Close deregister-context race against CT-loss") Signed-off-by: Jesus Narvaez <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Alan Previn <[email protected]> Cc: Anshuman Gupta <[email protected]> Cc: Mousumi Jana <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Matt Roper <[email protected]> Reviewed-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: John Harrison <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit a6a2678) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent ed5915c commit c557fd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ static int guc_submission_send_busy_loop(struct intel_guc *guc,
633633
atomic_inc(&guc->outstanding_submission_g2h);
634634

635635
ret = intel_guc_send_busy_loop(guc, action, len, g2h_len_dw, loop);
636-
if (ret)
636+
if (ret && g2h_len_dw)
637637
atomic_dec(&guc->outstanding_submission_g2h);
638638

639639
return ret;

0 commit comments

Comments
 (0)