mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Marco Ziliani <rylos78@gmail.com>
Cc: Daniel Scally <dan.scally@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, Chris Simpson <chris@nilk.net>,
	Tony Garcia <tony@loafecho.com>,
	Simon Kruse <simon0x+git@proton.me>,
	"D. Manresa" <dmanresa@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] media: i2c: ov5693: Program the mode registers on stream start
Date: Fri, 20 Nov 2026 11:37:10 +0200	[thread overview]
Message-ID: <awAUxukyHCqtABs_@kekkonen.localdomain> (raw)
In-Reply-To: <20261029-ov5693-fixes-v2-1-2526d7b13030@gmail.com>

Hi Marco,

On Thu, Oct 29, 2026 at 10:27:52AM +0100, Marco Ziliani wrote:
> ov5693_mode_configure() is only called from the runtime PM resume path,
> through ov5693_sensor_init(). If the sensor stays powered between two
> streams with different modes, the settings for the second mode are never
> written to the hardware.
> 
> Move the call from ov5693_sensor_init() to ov5693_s_stream(), before the
> controls are applied, so that the mode is written on every stream start.
> 
> Fixes: 89aef879cb53 ("media: i2c: Add support for ov5693 sensor")
> Link: https://github.com/linux-surface/kernel/pull/181
> Signed-off-by: Marco Ziliani <rylos78@gmail.com>
> ---
>  drivers/media/i2c/ov5693.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
> index 56599f9ca..d09095c3e 100644
> --- a/drivers/media/i2c/ov5693.c
> +++ b/drivers/media/i2c/ov5693.c
> @@ -663,11 +663,6 @@ static int ov5693_sensor_init(struct ov5693_device *ov5693)
>  		return dev_err_probe(ov5693->dev, ret,
>  				     "global settings error\n");
>  
> -	ret = ov5693_mode_configure(ov5693);
> -	if (ret)
> -		return dev_err_probe(ov5693->dev, ret,
> -				     "mode configure error\n");
> -
>  	ret = ov5693_enable_streaming(ov5693, false);
>  	if (ret)
>  		dev_err(ov5693->dev, "stop streaming error\n");
> @@ -1000,6 +995,19 @@ static int ov5693_s_stream(struct v4l2_subdev *sd, int enable)
>  			return ret;
>  
>  		mutex_lock(&ov5693->lock);
> +
> +		/*
> +		 * Program the mode on every stream start, so that a format
> +		 * change also reaches a sensor that stayed powered since the
> +		 * previous stream, and before the controls so that the mode
> +		 * registers don't clobber them.
> +		 */

This doesn't seem quite right. The static register list should be written
on power-on and the rest when they change. Also there shouldn't be overlap
between the register list and the registers programmatically determined by
the driver.

> +		ret = ov5693_mode_configure(ov5693);
> +		if (ret) {
> +			mutex_unlock(&ov5693->lock);
> +			goto err_power_down;
> +		}
> +
>  		ret = __v4l2_ctrl_handler_setup(&ov5693->ctrls.handler);
>  		if (ret) {
>  			mutex_unlock(&ov5693->lock);
> 

-- 
Regards,

Sakari Ailus

  parent reply	other threads:[~2026-11-20  9:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  9:27 [PATCH v2 0/3] media: i2c: ov5693: Fix mode changes, flips and autosuspend Marco Ziliani
2026-10-29  9:27 ` [PATCH v2 1/3] media: i2c: ov5693: Program the mode registers on stream start Marco Ziliani
2026-10-29 16:56   ` Chris Simpson
2026-11-03 21:01   ` technosf
2026-11-20  9:37   ` Sakari Ailus [this message]
2026-11-20 17:28     ` Marco Ziliani
2026-10-29  9:27 ` [PATCH v2 2/3] media: i2c: ov5693: Keep the Bayer order when flipping at full resolution Marco Ziliani
2026-10-29  9:27 ` [PATCH v2 3/3] media: i2c: ov5693: Use autosuspend when stopping the stream Marco Ziliani

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=awAUxukyHCqtABs_@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=chris@nilk.net \
    --cc=dan.scally@ideasonboard.com \
    --cc=dmanresa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rylos78@gmail.com \
    --cc=simon0x+git@proton.me \
    --cc=tony@loafecho.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®