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

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

 



Hello Markus,

Thank you for your review.

> -----Original Message-----
> From: Markus Elfring <Markus.Elfring@xxxxxx>
> Sent: Tuesday, July 9, 2024 4:48 PM
> To: ishikawa yuji(石川 悠司 ○RDC□AITC○EA開)
> <yuji2.ishikawa@xxxxxxxxxxxxx>; linux-media@xxxxxxxxxxxxxxx;
> devicetree@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; Conor
> Dooley <conor+dt@xxxxxxxxxx>; Hans Verkuil <hverkuil@xxxxxxxxx>; Krzysztof
> Kozlowski <krzk+dt@xxxxxxxxxx>; Laurent Pinchart
> <laurent.pinchart@xxxxxxxxxxxxxxxx>; Mark Brown <broonie@xxxxxxxxxx>;
> Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>; iwamatsu nobuhiro(岩松 信
> 洋 ○DITC□DIT○OST) <nobuhiro1.iwamatsu@xxxxxxxxxxxxx>; Rob
> Herring <robh@xxxxxxxxxx>; Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> Cc: LKML <linux-kernel@xxxxxxxxxxxxxxx>
> 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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux