[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<OSZPR01MB94276B6A6E1F84D894D088D492AC2@OSZPR01MB9427.jpnprd01.prod.outlook.com>
Date: Thu, 18 Jul 2024 23:46:36 +0000
From: <yuji2.ishikawa@...hiba.co.jp>
To: <Markus.Elfring@....de>, <linux-media@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<conor+dt@...nel.org>, <hverkuil@...all.nl>, <krzk+dt@...nel.org>,
<laurent.pinchart@...asonboard.com>, <broonie@...nel.org>,
<mchehab@...nel.org>, <nobuhiro1.iwamatsu@...hiba.co.jp>,
<robh@...nel.org>, <sakari.ailus@...ux.intel.com>
CC: <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v11 3/6] media: platform: visconti: Add Toshiba Visconti
Video Input Interface driver
Hello Markus,
Thank you for your review.
> -----Original Message-----
> From: Markus Elfring <Markus.Elfring@....de>
> Sent: Tuesday, July 9, 2024 4:48 PM
> To: ishikawa yuji(石川 悠司 ○RDC□AITC○EA開)
> <yuji2.ishikawa@...hiba.co.jp>; linux-media@...r.kernel.org;
> devicetree@...r.kernel.org; linux-arm-kernel@...ts.infradead.org; Conor
> Dooley <conor+dt@...nel.org>; Hans Verkuil <hverkuil@...all.nl>; Krzysztof
> Kozlowski <krzk+dt@...nel.org>; Laurent Pinchart
> <laurent.pinchart@...asonboard.com>; Mark Brown <broonie@...nel.org>;
> Mauro Carvalho Chehab <mchehab@...nel.org>; iwamatsu nobuhiro(岩松 信
> 洋 ○DITC□DIT○OST) <nobuhiro1.iwamatsu@...hiba.co.jp>; Rob
> Herring <robh@...nel.org>; Sakari Ailus <sakari.ailus@...ux.intel.com>
> Cc: LKML <linux-kernel@...r.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
Powered by blists - more mailing lists