Re: [PATCH v3 2/2] drm/bridge: add support for lontium lt8713sx bridge driver
From: Vishnu Saini
Date: Fri Feb 20 2026 - 04:22:47 EST
On Mon, Dec 29, 2025 at 01:40:10PM +0100, Markus Elfring wrote:
> …
> > +++ b/drivers/gpu/drm/bridge/lontium-lt8713sx.c
> > @@ -0,0 +1,682 @@
> …
> > +static int lt8713sx_firmware_update(struct lt8713sx *lt8713sx)
> > +{
> > + int ret = 0;
> > +
> > + mutex_lock(<8713sx->ocm_lock);
> > + lt8713sx_i2c_enable(lt8713sx);
> …
> > + mutex_unlock(<8713sx->ocm_lock);
> > +
> > + return ret;
> > +}
> …
>
> Under which circumstances would you become interested to apply a statement
> like “guard(mutex)(<8713sx->ocm_lock);”?
> https://elixir.bootlin.com/linux/v6.19-rc2/source/include/linux/mutex.h#L253
This function holds ocm_lock across the entire firmware update sequence and has multiple error exits. It is therefore a good candidate for guard(mutex) to simplify error handling and guarantee unlock on all paths. I will convert it to scoped locking using guard(mutex).
> Regards,
> Markus