mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: xiaolei <xiaoleiwangxiaolei@gmail.com>
To: hverkuil+cisco@kernel.org, sakari.ailus@linux.intel.com,
	mehdi.djait@linux.intel.com, u.kleine-koenig@baylibre.com,
	laurent.pinchart@ideasonboard.com, jacopo@jmondi.org,
	p.zabel@pengutronix.de, ezequiel@vanguardiasur.com.ar,
	mchehab+samsung@kernel.org, festevam@gmail.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@kernel.org
Subject: Re: [PATCH v2] media: i2c: ov5645: Keep the sensor in software power-down during init
Date: Thu, 8 Oct 2026 16:54:32 +0800	[thread overview]
Message-ID: <c90bc935-5e78-41a3-a05b-cedb1331b84c@gmail.com> (raw)
In-Reply-To: <20260914024240.152741-1-xiaoleiwangxiaolei@gmail.com>

Humble ping...

thanks

xiaolei

On 9/14/26 10:42, Xiaolei Wang wrote:
> On the RK3576 platform, after ov5645_global_init_setting completes and
> before stream on, the CSI host reports a high rate of CRC errors:
>
>    MIPI_CSI2 ERR1:0x1000000 (crc,vc: 0)
>
> These errors occur exclusively in the window between init completion and
> stream on. Once preview starts and the sensor outputs valid HS data, no
> further CRC errors are observed.
>
> Commit 092e8eb90a7d ("media: i2c: ov5645: Fix power sequence") reworked
> the power sequence to properly enter LP-11 during power-up. As part of
> this change, the SYSTEM_CTRL0_STOP (0x42) write on the power-up path was
> replaced with usleep_range(500, 1000). Since ov5645_global_init_setting[]
> ends with SYSTEM_CTRL0_START (0x02), the sensor core is left awake from
> the end of initialisation all the way to stream on, driving the data
> lanes while the host is not expecting any traffic. Reverting the commit
> resolves the CRC errors, confirming it as the triggering change.
>
> ov5645_global_init_setting[] writes SYSTEM_CTRL0 four times: STOP at the
> very beginning, then START, STOP and START again near the end. Register
> writes are accepted over I2C while the sensor is in software power-down,
> so there is no reason to leave it briefly, and the three trailing writes
> serve no purpose. Drop them and keep the sensor in software power-down
> for the whole initialisation sequence. It is woken up only by
> ov5645_enable_streams(), once the host is ready to receive data.
>
> This preserves the LP-11 compliance improvements from commit
> 092e8eb90a7d ("media: i2c: ov5645: Fix power sequence"), as the MIPI PHY
> stays powered and parked in LP-11, while eliminating the CRC errors on
> RK3576.
>
> While at it, use the register macros for the remaining SYSTEM_CTRL0
> write.
>
> Fixes: 092e8eb90a7d ("media: i2c: ov5645: Fix power sequence")
> Cc: stable@kernel.org
> Signed-off-by: Xiaolei Wang <xiaoleiwangxiaolei@gmail.com>
> ---
>
> Changes in v2:
>    - Instead of appending another SYSTEM_CTRL0_STOP write, remove the three
>      redundant SYSTEM_CTRL0 writes at the end of the init sequence, so the
>      sensor simply stays in software power-down from the initial STOP until
>      stream on
>    - Use OV5645_SYSTEM_CTRL0 / OV5645_SYSTEM_CTRL0_STOP instead of raw
>      values for the remaining write
>
> Link to v1: https://patchwork.linuxtv.org/project/linux-media/patch/20260826085432.1482348-1-xiaoleiwangxiaolei@gmail.com/
>
>   drivers/media/i2c/ov5645.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
> index c772ef6e51d2..2985966ab09f 100644
> --- a/drivers/media/i2c/ov5645.c
> +++ b/drivers/media/i2c/ov5645.c
> @@ -115,7 +115,7 @@ static inline struct ov5645 *to_ov5645(struct v4l2_subdev *sd)
>   
>   static const struct reg_value ov5645_global_init_setting[] = {
>   	{ 0x3103, 0x11 },
> -	{ 0x3008, 0x42 },
> +	{ OV5645_SYSTEM_CTRL0, OV5645_SYSTEM_CTRL0_STOP },
>   	{ 0x3103, 0x03 },
>   	{ 0x3503, 0x07 },
>   	{ 0x3002, 0x1c },
> @@ -198,7 +198,6 @@ static const struct reg_value ov5645_global_init_setting[] = {
>   	{ 0x5a00, 0x08 },
>   	{ 0x5a21, 0x00 },
>   	{ 0x5a24, 0x00 },
> -	{ 0x3008, 0x02 },
>   	{ 0x3503, 0x00 },
>   	{ 0x5180, 0xff },
>   	{ 0x5181, 0xf2 },
> @@ -347,8 +346,6 @@ static const struct reg_value ov5645_global_init_setting[] = {
>   	{ 0x3a11, 0x60 },
>   	{ 0x3a1f, 0x14 },
>   	{ 0x0601, 0x02 },
> -	{ 0x3008, 0x42 },
> -	{ 0x3008, 0x02 },
>   	{ OV5645_IO_MIPI_CTRL00, 0x40 },
>   	{ OV5645_MIPI_CTRL00, 0x24 },
>   	{ OV5645_PAD_OUTPUT00, 0x70 }

      reply	other threads:[~2026-10-08  8:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  2:42 Xiaolei Wang
2026-10-08  8:54 ` xiaolei [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=c90bc935-5e78-41a3-a05b-cedb1331b84c@gmail.com \
    --to=xiaoleiwangxiaolei@gmail.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=festevam@gmail.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jacopo@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@kernel.org \
    --cc=u.kleine-koenig@baylibre.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®