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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-UzEnagFzWTnt_k@kekkonen.localdomain>
Date: Thu, 27 Mar 2025 11:14:26 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Tarang Raval <tarang.raval@...iconsignals.io>
Cc: "kieran.bingham@...asonboard.com" <kieran.bingham@...asonboard.com>,
	"Shravan.Chippa@...rochip.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-media@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/6] media: i2c: imx334: Enable runtime PM before
 sub-device registration

On Thu, Mar 27, 2025 at 11:02:33AM +0000, Tarang Raval wrote:
> Hi Sakari,
> 
> Thanks for the review.
> 
> > 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.
> 
> Oh, I missed that.
>   
> > 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?
>  
> Should I include these changes in this patch, or should I create a separate 
> patch for them.

A separate patch would be better as it could be cc'd to stable as well.
Probably this issue has been there all along...

-- 
Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ