From: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
To: Jizhou Tong <fqwqf@fqwqf.xyz>, <sakari.ailus@linux.intel.com>,
<sylvain.petinot@foss.st.com>
Cc: <mchehab@kernel.org>, <hverkuil@kernel.org>,
<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] media: i2c: vd55g1: stop streaming after an exposure read error
Date: Tue, 13 Oct 2026 11:24:56 +0200 [thread overview]
Message-ID: <029be84f-fe2d-411c-87af-ce7de8af45ee@foss.st.com> (raw)
In-Reply-To: <010601a1333dc788-a5673ae3-b4b1-44a3-b10e-9698fc58f2ea-000000@ap-northeast-1.amazonses.com>
Hi,
Le 13/10/2026 à 05:10, Jizhou Tong a écrit :
> 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.
>
> Signed-off-by: Jizhou Tong <fqwqf@fqwqf.xyz>
Reviewed-By: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
> ---
> Changes in v3: reference the CCI error-accumulator API in the
> stream-off comment. No functional changes from v2.
>
> Fault-injection harness:
> https://gist.github.com/fQwQf/60bd12627e06b10a2fc159e545f85dae/7b21a7d3a1b676a0e4cdaba06168ede09a2949e3
>
> drivers/media/i2c/vd55g1.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
> index 78e4aebfdd3b24b867ea4d077dc1b676c4a595da..e78835f014e65bfc2b3dcc2aaee7b054fb5da390 100644
> --- a/drivers/media/i2c/vd55g1.c
> +++ b/drivers/media/i2c/vd55g1.c
> @@ -1190,6 +1190,14 @@ 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);
> +
> + /*
> + * cci_write() skips writes when its error accumulator is set
> + * (see include/media/v4l2-cci.h). Start a separate stop sequence.
> + */
> + ret = 0;
>
> vd55g1_write(sensor, VD55G1_REG_STREAMING, VD55G1_STREAMING_STOP_STREAM,
> &ret);
--
Regards,
Benjamin
prev parent reply other threads:[~2026-10-13 9:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 9:23 [PATCH v2 0/2] media: i2c: vd55g1: preserve stream errors and always attempt stop fQwQf
2026-10-13 2:54 ` [PATCH v3 " Jizhou Tong
2026-10-13 3:10 ` [PATCH v3 1/2] media: i2c: vd55g1: preserve the stream-start error Jizhou Tong
2026-10-13 9:24 ` Benjamin Mugnier
2026-10-13 3:10 ` [PATCH v3 2/2] media: i2c: vd55g1: stop streaming after an exposure read error Jizhou Tong
2026-10-13 9:24 ` Benjamin Mugnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=029be84f-fe2d-411c-87af-ce7de8af45ee@foss.st.com \
--to=benjamin.mugnier@foss.st.com \
--cc=fqwqf@fqwqf.xyz \
--cc=hverkuil@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sylvain.petinot@foss.st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®