All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	"open list:SAMSUNG S5P/EXYNO..." <linux-media@vger.kernel.org>
Subject: Re: [PATCH v5] videobuf2: Add missing lock held on vb2_fop_relase
Date: Wed, 06 Nov 2013 15:51:00 +0100	[thread overview]
Message-ID: <527A5754.70400@xs4all.nl> (raw)
In-Reply-To: <527A563A.8090805@samsung.com>

On 11/06/13 15:46, Sylwester Nawrocki wrote:
> Hello,
> 
> (dropping some unrelated e-mail addresses from Cc)
> 
> On 06/11/13 10:07, Hans Verkuil wrote:
>> On 11/06/13 09:24, Ricardo Ribalda Delgado wrote:
>>> From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
>>>
>>> vb2_fop_relase does not held the lock although it is modifying the
>>
>> Small typo: _relase -> _release
>>
>>> queue->owner field.
>>>
> [...]
>>>
>>> Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
>>> ---
>>>
>>> v2: Comments by Sylvester Nawrocki
>>>
>>> fimc-capture and fimc-lite where calling vb2_fop_release with the lock held.
>>> Therefore a new __vb2_fop_release function has been created to be used by
>>> drivers that overload the release function.
>>>
>>> v3: Comments by Sylvester Nawrocki and Mauro Carvalho Chehab
>>>
>>> Use vb2_fop_release_locked instead of __vb2_fop_release
>>>
>>> v4: Comments by Sylvester Nawrocki
>>>
>>> Rename vb2_fop_release_locked to __vb2_fop_release and fix patch format
>>>
>>> v5: Comments by Sylvester Nawrocki and Hans Verkuil
>>>
>>> Rename __vb2_fop_release to vb2_fop_release_unlock and rearrange
>>> arguments
>>
>> I know I suggested the vb2_fop_release_unlock name, but on second thoughts
>> that's not a good name. I suggest vb2_fop_release_no_lock instead.
>> '_unlock' suggests that there is a _lock version as well, which isn't the
>> case here.
> 
> Yes. Sorry, but to me vb2_fop_release_no_lock() looks s bit ugly.
> Couldn't we just use double underscore prefix instead of _no_lock postfix,
> as is commonly done in the kernel ?

I'm not keen on that since we then end up with a no-prefix version, a '_'
version and a '__' version. A bit obscure IMHO.

How about just exporting the _vb2_fop_release function and pass a NULL
pointer as lock?

> Grep reveals almost no use of "_no_lock" in function names.

Usually the version without prefix doesn't lock, and you have a _lock
version that does lock. Unfortunately, we couldn't use that here.

Regards,

	Hans

  reply	other threads:[~2013-11-06 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  8:24 [PATCH v5] videobuf2: Add missing lock held on vb2_fop_relase Ricardo Ribalda Delgado
2013-11-06  8:24 ` Ricardo Ribalda Delgado
2013-11-06  9:07 ` Hans Verkuil
2013-11-06  9:07   ` Hans Verkuil
2013-11-06  9:11   ` Ricardo Ribalda Delgado
2013-11-06  9:11     ` Ricardo Ribalda Delgado
2013-11-06 14:46   ` Sylwester Nawrocki
2013-11-06 14:51     ` Hans Verkuil [this message]
2013-11-06 15:22       ` Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527A5754.70400@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    --cc=ricardo.ribalda@gmail.com \
    --cc=s.nawrocki@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.