[PATCH v11 3/6] media: platform: visconti: Add Toshiba Visconti Video Input Interface driver

yuji2.ishikawa at toshiba.co.jp yuji2.ishikawa at toshiba.co.jp
Thu Jul 18 16:46:36 PDT 2024


Hello Markus,

Thank you for your review.

> -----Original Message-----
> From: Markus Elfring <Markus.Elfring at web.de>
> Sent: Tuesday, July 9, 2024 4:48 PM
> To: ishikawa yuji(石川 悠司 ○RDC□AITC○EA開)
> <yuji2.ishikawa at toshiba.co.jp>; linux-media at vger.kernel.org;
> devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; Conor
> Dooley <conor+dt at kernel.org>; Hans Verkuil <hverkuil at xs4all.nl>; Krzysztof
> Kozlowski <krzk+dt at kernel.org>; Laurent Pinchart
> <laurent.pinchart at ideasonboard.com>; Mark Brown <broonie at kernel.org>;
> Mauro Carvalho Chehab <mchehab at kernel.org>; iwamatsu nobuhiro(岩松 信
> 洋 ○DITC□DIT○OST) <nobuhiro1.iwamatsu at toshiba.co.jp>; Rob
> Herring <robh at kernel.org>; Sakari Ailus <sakari.ailus at linux.intel.com>
> Cc: LKML <linux-kernel at vger.kernel.org>
> Subject: Re: [PATCH v11 3/6] media: platform: visconti: Add Toshiba Visconti
> Video Input Interface driver
> 
>> > +++ b/drivers/media/platform/toshiba/visconti/viif_capture.c
> > @@ -0,0 +1,1431 @@
>> > +static int viif_set_img(struct cap_dev *cap_dev, struct vb2_buffer
> > +*vb) {
>> > +	if (cap_dev->pathid == CAPTURE_PATH_MAIN_POST0) {
> > +		spin_lock(&viif_dev->regbuf_lock);
> > +		hwd_viif_isp_guard_start(viif_dev);
>> > +		hwd_viif_isp_guard_end(viif_dev);
> > +		spin_unlock(&viif_dev->regbuf_lock);
>> 
> Under which circumstances would you become interested to apply a statement
> like “guard(spinlock)(&viif_dev->regbuf_lock);”?
> https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/spinlock.h#L5
> 61

Thank you for the interesting advice encouraging me to use guard macros.

I investigated the implementation of the DEFINE_LOCK_GUARD_1 macro and guard macro.
Also, I checked a web article of __cleanup__ attribute and its applications [*1].
Now I understand that the use of guard macros can provide the same functionality
as a combination of spin_lock() and spin_unlock concisely.

I'll try use guard macros for the next patch.

*1: https://javiercarrascocruz.github.io/kernel-auto-cleanup-1

> 
> Regards,
> Markus

Regards,
Yuji


More information about the linux-arm-kernel mailing list