mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Pavel Machek <pavel@denx.de>,
	Andrey Konovalov <andrey.konovalov@linaro.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Jacopo Mondi <jacopo@jmondi.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Prabhakar <prabhakar.csengg@gmail.com>,
	Biju Das <biju.das.jz@bp.renesas.com>
Subject: Re: [PATCH v2 1/2] media: i2c: imx219: Move out locking/unlocking of vflip and hflip controls from imx219_set_stream
Date: Mon, 15 Mar 2021 02:02:41 +0200	[thread overview]
Message-ID: <YE6kIVV71qKlUAan@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210311095205.8095-2-prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi Prabhakar,

Thank you for the patch.

On Thu, Mar 11, 2021 at 09:52:04AM +0000, Lad Prabhakar wrote:
> Move out locking/unlocking of vflip and hflip controls from
> imx219_set_stream() to the imx219_start_streaming()/
> imx219_stop_streaming() respectively.
> 
> This fixes an issue in resume callback error path where streaming is
> stopped and the controls are left in locked state.
> 
> Fixes: 1283b3b8f82b9 ("media: i2c: Add driver for Sony IMX219 sensor")
> Reported-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/imx219.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
> index 6e3382b85a90..82756cbfbaac 100644
> --- a/drivers/media/i2c/imx219.c
> +++ b/drivers/media/i2c/imx219.c
> @@ -1056,8 +1056,16 @@ static int imx219_start_streaming(struct imx219 *imx219)
>  		return ret;
>  
>  	/* set stream on register */
> -	return imx219_write_reg(imx219, IMX219_REG_MODE_SELECT,
> -				IMX219_REG_VALUE_08BIT, IMX219_MODE_STREAMING);
> +	ret = imx219_write_reg(imx219, IMX219_REG_MODE_SELECT,
> +			       IMX219_REG_VALUE_08BIT, IMX219_MODE_STREAMING);
> +	if (ret)
> +		return ret;
> +
> +	/* vflip and hflip cannot change during streaming */
> +	__v4l2_ctrl_grab(imx219->vflip, true);
> +	__v4l2_ctrl_grab(imx219->hflip, true);
> +
> +	return 0;
>  }
>  
>  static void imx219_stop_streaming(struct imx219 *imx219)
> @@ -1070,6 +1078,9 @@ static void imx219_stop_streaming(struct imx219 *imx219)
>  			       IMX219_REG_VALUE_08BIT, IMX219_MODE_STANDBY);
>  	if (ret)
>  		dev_err(&client->dev, "%s failed to set stream\n", __func__);
> +
> +	__v4l2_ctrl_grab(imx219->vflip, false);
> +	__v4l2_ctrl_grab(imx219->hflip, false);
>  }
>  
>  static int imx219_set_stream(struct v4l2_subdev *sd, int enable)
> @@ -1105,10 +1116,6 @@ static int imx219_set_stream(struct v4l2_subdev *sd, int enable)
>  
>  	imx219->streaming = enable;
>  
> -	/* vflip and hflip cannot change during streaming */
> -	__v4l2_ctrl_grab(imx219->vflip, enable);
> -	__v4l2_ctrl_grab(imx219->hflip, enable);
> -
>  	mutex_unlock(&imx219->mutex);
>  
>  	return ret;

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-03-15  0:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  9:52 [PATCH v2 0/2] media: i2c: imx219: Trivial Fixes Lad Prabhakar
2021-03-11  9:52 ` [PATCH v2 1/2] media: i2c: imx219: Move out locking/unlocking of vflip and hflip controls from imx219_set_stream Lad Prabhakar
2021-03-15  0:02   ` Laurent Pinchart [this message]
2021-03-11  9:52 ` [PATCH v2 2/2] media: i2c: imx219: Balance runtime PM use-count Lad Prabhakar
2021-03-15  0:03   ` Laurent Pinchart

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=YE6kIVV71qKlUAan@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=andrey.konovalov@linaro.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pavel@denx.de \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=sakari.ailus@linux.intel.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®