mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Scally <dan.scally@ideasonboard.com>
To: rylos78@gmail.com, Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, Chris Simpson <chris@nilk.net>,
	Simon Kruse <simon0x+git@proton.me>,
	"D. Manresa" <dmanresa@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] media: i2c: ov5693: Use autosuspend when stopping the stream
Date: Wed, 28 Oct 2026 08:19:00 +0000	[thread overview]
Message-ID: <aca04907-1ace-4fe2-8ca9-280c56b4b3e6@ideasonboard.com> (raw)
In-Reply-To: <20261027-ov5693-fixes-v1-3-3c8ab1ae104d@gmail.com>

Morning

On 27/10/2026 20:29, Marco Ziliani via B4 Relay wrote:
> From: Marco Ziliani <rylos78@gmail.com>
> 
> The driver enables runtime PM autosuspend with a 1 second delay at
> probe, but drops the usage count at stream stop with pm_runtime_put(),
> which doesn't update the device's last busy time. The autosuspend
> delay is then counted from the runtime resume at stream start rather
> than from stream stop, so after any stream longer than the delay the
> sensor is powered off right away.
> 
> Use pm_runtime_put_autosuspend(), which marks the device busy, so that
> the delay counts from stream stop as intended, and a following stream
> started within it doesn't power the sensor up from scratch again. With
> the mode now programmed on every stream start, keeping the sensor
> powered between streams no longer leaves it in a stale mode.
> 
> On a Surface Pro 9 (IPU6) with autosuspend_delay_ms set to 3000, the
> sensor suspended 1-2 ms after a 5 s stream stopped; with this change,
> 3.7 s after it, i.e. the delay plus the autosuspend timer slack. On a
> Surface Pro 5 (IPU3) with the default 1 s delay, the sensor suspended
> as soon as a 2 s stream stopped; with this change, 1.1 s after it.
> 
> Fixes: 89aef879cb53 ("media: i2c: Add support for ov5693 sensor")
> Reported-by: D. Manresa <dmanresa@gmail.com>
> Closes: https://github.com/linux-surface/kernel/pull/181#issuecomment-6436016335
> Signed-off-by: Marco Ziliani <rylos78@gmail.com>
> ---
>   drivers/media/i2c/ov5693.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
> index ca0968498..ef5e7285c 100644
> --- a/drivers/media/i2c/ov5693.c
> +++ b/drivers/media/i2c/ov5693.c
> @@ -1070,7 +1070,7 @@ static int ov5693_s_stream(struct v4l2_subdev *sd, int enable)
>   		goto err_power_down;
>   
>   	if (!enable)
> -		pm_runtime_put(ov5693->dev);
> +		pm_runtime_put_autosuspend(ov5693->dev);

Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>

>   
>   	return 0;
>   err_power_down:
> 


  reply	other threads:[~2026-10-28  8:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 20:29 [PATCH 0/3] media: i2c: ov5693: Fix mode changes, flips and autosuspend Marco Ziliani via B4 Relay
2026-10-27 20:29 ` [PATCH 1/3] media: i2c: ov5693: Program the mode registers on stream start Marco Ziliani via B4 Relay
2026-10-28  8:16   ` Dan Scally
2026-10-27 20:29 ` [PATCH 2/3] media: i2c: ov5693: Keep the Bayer order when flipping at full resolution Marco Ziliani via B4 Relay
2026-10-28  9:31   ` Dan Scally
2026-10-27 20:29 ` [PATCH 3/3] media: i2c: ov5693: Use autosuspend when stopping the stream Marco Ziliani via B4 Relay
2026-10-28  8:19   ` Dan Scally [this message]
2026-10-27 21:08 ` [PATCH 0/3] media: i2c: ov5693: Fix mode changes, flips and autosuspend Chris Simpson
2026-10-27 23:48 ` Tony Garcia
2026-10-28  8:29 ` Simon Kruse
2026-10-28  9:44   ` 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=aca04907-1ace-4fe2-8ca9-280c56b4b3e6@ideasonboard.com \
    --to=dan.scally@ideasonboard.com \
    --cc=chris@nilk.net \
    --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=sakari.ailus@linux.intel.com \
    --cc=simon0x+git@proton.me \
    /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®