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: <darls2mffvsw2ktkirzimzij6w5w45hxylvfcfwgmd3k3elmar@xeg6mfpa3yax>
Date: Mon, 29 Jul 2024 08:05:47 -0400
From: Alex Lanzano <lanzano.alex@...il.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Mehdi Djait <mehdi.djait@...tlin.com>, dri-devel@...ts.freedesktop.org, 
	devicetree@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>, 
	Christophe Jaillet <christophe.jaillet@...adoo.fr>, Conor Dooley <conor+dt@...nel.org>, 
	Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...il.com>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
	Maxime Ripard <mripard@...nel.org>, Rob Herring <robh@...nel.org>, 
	Thomas Zimmermann <tzimmermann@...e.de>
Subject: Re: [PATCH v3 2/2] drm/tiny: Add driver for Sharp Memory LCD

On Mon, Jul 29, 2024 at 01:00:47PM GMT, Markus Elfring wrote:
> …
> > +++ b/drivers/gpu/drm/tiny/sharp-memory.c
> > @@ -0,0 +1,684 @@
> …
> > static int sharp_memory_update_display(struct sharp_memory_device *smd,
> > +				       struct drm_framebuffer *fb,
> > +				       struct drm_rect clip,
> > +				       struct drm_format_conv_state *fmtcnv_state)
> > +{
> …
> > +	mutex_lock(&smd->tx_mutex);
> > +
> > +	/* Populate the transmit buffer with frame data */
> …
> > +	mutex_unlock(&smd->tx_mutex);
> > +
> > +	return ret;
> > +}
> …
> 
> Under which circumstances would you become interested to apply a statement
> like “guard(mutex)(&smd->tx_mutex);”?
> https://elixir.bootlin.com/linux/v6.10.2/source/include/linux/mutex.h#L196
> 

Ah, I didn't realize guarded mutexes were implemented. That's really
good to know.

I'd usually use them when it's possible to return before mutex_unlock is
called to avoid goto cleanup logic. But it's probably best to just use them
by default.

Thanks for the review. Will clean up in v4.

Best regards,
Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ