[PATCH 5/8] media: qcom: camss: vfe: only reset the VFE when its last line stops
From: Hitesh Patel
Date: Mon Sep 14 2026 - 11:33:28 EST
vfe_disable_output() stops the write masters of the line being
disabled and then issues a global VFE reset. The reset is not scoped
to the line: it resets the whole block.
Several lines of one VFE stream at the same time when a CSID
demultiplexes virtual channels to different RDIs, e.g. two GMSL
cameras aggregated by a MAX9296A onto one CSI-2 port, each on its
own VC and RDI. Stopping one of them then resets the VFE underneath
the other: its in-flight buffers are never completed, its write
master configuration is gone and the block is left in a state where
the next reset is not acknowledged, which surfaces as
VFE reset timeout
when the remaining camera is stopped or restarted.
Only issue the reset when the line being disabled is the last one
streaming on this VFE, as tracked by vfe->stream_count. Stopping the
line's write masters is sufficient to quiesce it while other lines
keep running. The single-line case resets exactly as before.
Signed-off-by: Hitesh Patel <hitesh@xxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss-vfe.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index 319d19158..9cdf26671 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -814,6 +814,7 @@ static int vfe_disable_output(struct vfe_line *line)
struct vfe_output *output = &line->output;
unsigned long flags;
unsigned int i;
+ bool last;
spin_lock_irqsave(&vfe->output_lock, flags);
for (i = 0; i < output->wm_num; i++)
@@ -821,6 +822,13 @@ static int vfe_disable_output(struct vfe_line *line)
output->gen2.active_num = 0;
spin_unlock_irqrestore(&vfe->output_lock, flags);
+ mutex_lock(&vfe->stream_lock);
+ last = vfe->stream_count == 1;
+ mutex_unlock(&vfe->stream_lock);
+
+ if (!last)
+ return 0;
+
return vfe_reset(vfe);
}
--
2.43.0