Re: [PATCH v4 1/5] drm/vc4: dsi: Set the transfer result before completing the transfer

From: Dave Stevenson

Date: Wed Nov 18 2026 - 13:10:44 EST


On Wed, 28 Oct 2026 at 16:46, Henry Zhang <henryzhang62@xxxxxxxxx> wrote:
>
> On an HSTX timeout the interrupt handler completes the transfer and
> only then sets xfer_result to -ETIMEDOUT. The waiter, which may run on
> another CPU, can wake up and read xfer_result in between, still 0 from
> the start of the transfer, and report the timed-out transfer as a
> success.
>
> Set xfer_result first. complete() orders the store before the wake-up.
>
> Fixes: 4078f5757144 ("drm/vc4: Add DSI driver")
> Signed-off-by: Henry Zhang <henryzhang62@xxxxxxxxx>

Reviewed-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>

> ---
> drivers/gpu/drm/vc4/vc4_dsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
> index 5ed3c35ee..aa2b46fb0 100644
> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
> @@ -1526,8 +1526,8 @@ static irqreturn_t vc4_dsi_irq_handler(int irq, void *data)
> complete(&dsi->xfer_completion);
> ret = IRQ_HANDLED;
> } else if (stat & DSI_PORT_BIT(INT_HSTX_TO)) {
> - complete(&dsi->xfer_completion);
> dsi->xfer_result = -ETIMEDOUT;
> + complete(&dsi->xfer_completion);
> ret = IRQ_HANDLED;
> }
>
> --
> 2.47.3
>