Re: [PATCH v3 1/5] media: qcom: camss: vfe-17x: Fix write master buffer done being dropped
From: Loic Poulain
Date: Mon Sep 28 2026 - 03:45:15 EST
On Mon, Sep 28, 2026 at 8:43 AM Hitesh Patel <hitesh@xxxxxxxxxxxxxx> wrote:
>
> The VFE 17x interrupt handler reads and clears the bus status
> registers on every interrupt, but only acts on the per write master
> BUF_DONE bits when bit 9 of IRQ_STATUS_0 is set as well. Bit 9 is the
> ping-pong flag of image master 1. It has nothing to do with the other
> write masters, and it is not guaranteed to be set in the same
> interrupt in which a write master reports a completed buffer.
>
> The bus status is read-to-clear. When a buffer done arrives while bit
> 9 is not set, the handler clears the status and never calls
> wm_done() for it. The buffer stays queued in the driver and the video
> node never receives that frame.
>
> With one RDI streaming this is rare. With two RDIs streaming on the
> same VFE, for instance two virtual channels demultiplexed by the CSID,
> the interrupt rate doubles and one of the two lines loses buffer done
> events continuously.
>
> Act on the bus status alone, as the other gen2 VFE handlers do.
>
> Fixes: 7319cdf189bb ("media: camss: Add support for VFE hardware version Titan 170")
> Signed-off-by: Hitesh Patel <hitesh@xxxxxxxxxxxxxx>
Reviewed-by: Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/camss/camss-vfe-17x.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe-17x.c b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
> index e5ee7e717b..c011f64f63 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe-17x.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe-17x.c
> @@ -364,9 +364,8 @@ static irqreturn_t vfe_isr(int irq, void *dev)
> vfe->isr_ops.comp_done(vfe, i);
>
> for (wm = 0; wm < MSM_VFE_IMAGE_MASTERS_NUM; wm++)
> - if (status0 & BIT(9))
> - if (vfe_bus_status[1] & STATUS1_WM_CLIENT_BUF_DONE(wm))
> - vfe->isr_ops.wm_done(vfe, wm);
> + if (vfe_bus_status[1] & STATUS1_WM_CLIENT_BUF_DONE(wm))
> + vfe->isr_ops.wm_done(vfe, wm);
>
> return IRQ_HANDLED;
> }
> --
> 2.43.0
>