Re: [PATCH 11/13] media: i2c: os05b10: Update active format before adjusting framing controls

From: Sakari Ailus

Date: Fri Mar 06 2026 - 08:43:51 EST


Hi Tarang,

On Fri, Mar 06, 2026 at 06:03:01PM +0530, Tarang Raval wrote:
> os05b10_set_pad_format() calls os05b10_set_framing_limits() before updating
> the ACTIVE format. As a result, the VBLANK control handler uses the old
> height when recalculating exposure limits, causing -ERANGE when switching
> to a larger resolution.
>
> Update the ACTIVE format before adjusting framing controls so control
> callbacks use the correct dimensions.
>
> Signed-off-by: Tarang Raval <tarang.raval@xxxxxxxxxxxxxxxxx>
> ---
> drivers/media/i2c/os05b10.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/os05b10.c b/drivers/media/i2c/os05b10.c
> index 4601e33b7e8f..476dbcb49351 100644
> --- a/drivers/media/i2c/os05b10.c
> +++ b/drivers/media/i2c/os05b10.c
> @@ -902,14 +902,14 @@ static int os05b10_set_pad_format(struct v4l2_subdev *sd,
>
> format = v4l2_subdev_state_get_format(sd_state, 0);
>
> + *format = fmt->format;
> +
> if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
> ret = os05b10_set_framing_limits(os05b10, mode);

Does it take a driver bug for this to happen? Presumably? I guess the
result would be somewhat inconsistent state in any case.

> if (ret)
> return ret;
> }
>
> - *format = fmt->format;
> -
> return 0;
> }
>

--
Regards,

Sakari Ailus