Skip to content

Commit

Permalink
drm/v3d: Fix race-condition between DRM scheduler and IRQs
Browse files Browse the repository at this point in the history
Link: #6624
Fixes: e4b5ccd ("drm/v3d: Ensure job pointer is set to NULL after job completion")
Signed-off-by: Maíra Canal <[email protected]>
Co-authored-by: Maíra Canal <[email protected]>
  • Loading branch information
pelwell and mairacanal authored Jan 22, 2025
1 parent d53a520 commit 3e79c56
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/gpu/drm/v3d/v3d_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ v3d_irq(int irq, void *arg)

v3d_job_update_stats(&v3d->bin_job->base, V3D_BIN);
trace_v3d_bcl_irq(&v3d->drm, fence->seqno);
dma_fence_signal(&fence->base);

v3d->bin_job = NULL;
dma_fence_signal(&fence->base);

status = IRQ_HANDLED;
}

Expand All @@ -118,8 +120,10 @@ v3d_irq(int irq, void *arg)

v3d_job_update_stats(&v3d->render_job->base, V3D_RENDER);
trace_v3d_rcl_irq(&v3d->drm, fence->seqno);
dma_fence_signal(&fence->base);

v3d->render_job = NULL;
dma_fence_signal(&fence->base);

status = IRQ_HANDLED;
}

Expand All @@ -129,8 +133,10 @@ v3d_irq(int irq, void *arg)

v3d_job_update_stats(&v3d->csd_job->base, V3D_CSD);
trace_v3d_csd_irq(&v3d->drm, fence->seqno);
dma_fence_signal(&fence->base);

v3d->csd_job = NULL;
dma_fence_signal(&fence->base);

status = IRQ_HANDLED;
}

Expand Down Expand Up @@ -167,8 +173,10 @@ v3d_hub_irq(int irq, void *arg)

v3d_job_update_stats(&v3d->tfu_job->base, V3D_TFU);
trace_v3d_tfu_irq(&v3d->drm, fence->seqno);
dma_fence_signal(&fence->base);

v3d->tfu_job = NULL;
dma_fence_signal(&fence->base);

status = IRQ_HANDLED;
}

Expand Down

0 comments on commit 3e79c56

Please sign in to comment.