lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-UjLSsATevtLT2k@kekkonen.localdomain>
Date: Thu, 27 Mar 2025 10:06:37 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Tarang Raval <tarang.raval@...iconsignals.io>
Cc: kieran.bingham@...asonboard.com, Shravan.Chippa@...rochip.com,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Hans Verkuil <hverkuil@...all.nl>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Julien Massot <julien.massot@...labora.com>,
	Zhi Mao <zhi.mao@...iatek.com>,
	Mikhail Rudenko <mike.rudenko@...il.com>,
	Benjamin Mugnier <benjamin.mugnier@...s.st.com>,
	Luis Garcia <git@...gi311.com>, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] media: i2c: imx334: Enable runtime PM before
 sub-device registration

Hi Tarang,

On Mon, Mar 10, 2025 at 12:47:48PM +0530, Tarang Raval wrote:
> Runtime PM is fully initialized before calling
> v4l2_async_register_subdev_sensor(). Moving the runtime PM initialization
> earlier prevents potential access to an uninitialized or powered-down device.
> 
> Signed-off-by: Tarang Raval <tarang.raval@...iconsignals.io>
> ---
>  drivers/media/i2c/imx334.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
> index ffa39bb317f7..8964d60324e2 100644
> --- a/drivers/media/i2c/imx334.c
> +++ b/drivers/media/i2c/imx334.c
> @@ -1295,6 +1295,9 @@ static int imx334_probe(struct i2c_client *client)
>  		goto error_handler_free;
>  	}
>  
> +	pm_runtime_set_active(imx334->dev);
> +	pm_runtime_enable(imx334->dev);
> +
>  	ret = v4l2_async_register_subdev_sensor(&imx334->sd);
>  	if (ret < 0) {
>  		dev_err(imx334->dev,
> @@ -1302,8 +1305,6 @@ static int imx334_probe(struct i2c_client *client)
>  		goto error_media_entity;
>  	}
>  
> -	pm_runtime_set_active(imx334->dev);
> -	pm_runtime_enable(imx334->dev);

Please also change error handling accordingly.

Btw. the remove function calls pm_runtime_suspended() that does nothing
(use pm_runtime_set_suspended() instead). Could you add a patch to fix it?

>  	pm_runtime_idle(imx334->dev);
>  
>  	return 0;

-- 
Regards,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ