Re: [PATCH 02/11] media: adv7180: Add missing lock in suspend callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025-07-04 02:06:01 +0300, Laurent Pinchart wrote:
> On Fri, Jul 04, 2025 at 12:51:39AM +0200, Niklas Söderlund wrote:
> > On 2025-07-04 01:43:26 +0300, Laurent Pinchart wrote:
> > > On Thu, Jul 03, 2025 at 10:52:14PM +0200, Niklas Söderlund wrote:
> > > > The adv7180_set_power() utilizes adv7180_write() which in turn requires
> > > > the state mutex to be held, take it before calling adv7180_set_power()
> > > > to avoid tripping a lockdep_assert_held().
> > > > 
> > > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
> > > > ---
> > > >  drivers/media/i2c/adv7180.c | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > > 
> > > > diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> > > > index 2519bc53333c..0c5511a7667d 100644
> > > > --- a/drivers/media/i2c/adv7180.c
> > > > +++ b/drivers/media/i2c/adv7180.c
> > > > @@ -1565,6 +1565,8 @@ static int adv7180_suspend(struct device *dev)
> > > >  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
> > > >  	struct adv7180_state *state = to_state(sd);
> > > >  
> > > > +	guard(mutex)(&state->mutex);
> > > > +
> > > >  	return adv7180_set_power(state, false);
> > > 
> > > Doesn't adv7180_resume() suffer from the same issue ? And how about
> > > adv7180_set_pad_format() ?
> > 
> > They do. But they will be fixed / reworked in later commits in the 
> > series. So it seems a but of churn to add a guard in this commit only to 
> > remove it later ;-)
> 
> It's a small churn :-) It would make the patch less confusing.

Ack, will fix for v2.

> 
> > > >  }
> > > >  
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Kind Regards,
Niklas Söderlund




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux