[PATCH v1 2/2] media: i2c: vd55g1: stop streaming after an exposure read error
From: Jizhou Tong
Date: Wed Sep 30 2026 - 03:16:48 EST
Stream-off saves exposure settings for the next automatic-exposure cold
start. If that read fails, its error is passed to the subsequent CCI
operations, which skip accesses when the error accumulator is nonzero.
The sensor stop command is therefore never issued, although the runtime
PM reference is released.
Log the exposure snapshot failure separately and clear the accumulator
before stopping the sensor. Treat the optional snapshot failure as a
warning: a successful stop returns success, while a stop failure is
returned to the caller. Completing stream shutdown takes precedence
over saving exposure settings for the next start.
Fixes: e56616d7b23c ("media: i2c: Add driver for ST VD55G1 camera sensor")
Signed-off-by: Jizhou Tong <fqwqf@xxxxxxxxx>
---
Fault-injection harness:
https://gist.github.com/fQwQf/60bd12627e06b10a2fc159e545f85dae/7b21a7d3a1b676a0e4cdaba06168ede09a2949e3
drivers/media/i2c/vd55g1.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index 78e4aebfdd3b24b867ea4d077dc1b676c4a595da..c0839593460a55d4ef91dfc85e0b9b476fbb34d7 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -1190,6 +1190,11 @@ static int vd55g1_disable_streams(struct v4l2_subdev *sd,
/* Retrieve Expo cluster to enable coldstart of AE */
ret = vd55g1_read_expo_cluster(sensor);
+ if (ret)
+ dev_warn(sensor->dev, "Failed to save exposure: %d\n", ret);
+
+ /* A failed exposure read must not prevent the stop command. */
+ ret = 0;
vd55g1_write(sensor, VD55G1_REG_STREAMING, VD55G1_STREAMING_STOP_STREAM,
&ret);
--
2.53.0