From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Andy Walls <awalls@md.metrocast.net>,
linux-media@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: RFC: BKL, locking and ioctls
Date: Sun, 19 Sep 2010 15:08:39 -0300 [thread overview]
Message-ID: <4C9651A7.4010707@redhat.com> (raw)
In-Reply-To: <201009191810.34189.hverkuil@xs4all.nl>
Em 19-09-2010 13:10, Hans Verkuil escreveu:
> On Sunday, September 19, 2010 17:38:18 Andy Walls wrote:
>> The device node isn't even the right place for drivers that provide multiple device nodes that can possibly access the same underlying data or register sets.
>>
>> Any core/infrastructure approach is likely doomed in the general case. It's trying to protect data and registers in a driver it knows nothing about, by protecting the *code paths* that take essentially unknown actions on that data and registers. :{
>
> Just to clarify: struct video_device gets a *pointer* to a mutex. The mutex
> itself can be either at the top-level device or associated with the actual
> video device, depending on the requirements of the driver.
>
>> Videobuf is the right place to protect videobuf data.
>
> vb_lock is AFAIK there to protect the streaming of data.
True, but part of this data is outside videobuf struct. So, a mutex inside videobuf is not enough.
See for example the tricks that bttv-driver need to do in order to protect data. I suspect that
there are even some race issues there, since it needs to unlock struct bttv in order to get videobuf
lock on some places.
> And that's definitely
> per device node since only one filehandle per device node can do streaming.
That's a wrong assumption. There are some drivers, like bttv, cx88 and saa7134 that allows streaming
on two separate file handlers, using the same device. This is valid according with V4L2 spec, and
some applications, like xawtv and xdtv assumes this behavior, when you try to record a video.
Cheers,
Mauro
next prev parent reply other threads:[~2010-09-19 18:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 15:38 RFC: BKL, locking and ioctls Andy Walls
2010-09-19 16:10 ` Hans Verkuil
2010-09-19 18:08 ` Mauro Carvalho Chehab [this message]
2010-09-19 18:38 ` Andy Walls
2010-09-19 19:10 ` Mauro Carvalho Chehab
2010-09-19 19:38 ` Hans Verkuil
2010-09-19 19:45 ` Hans Verkuil
2010-09-19 19:57 ` Andy Walls
2010-09-19 20:51 ` Mauro Carvalho Chehab
2010-09-20 1:52 ` Mauro Carvalho Chehab
2010-09-20 6:33 ` Hans Verkuil
-- strict thread matches above, loose matches on Subject: below --
2010-09-19 10:29 Hans Verkuil
2010-09-19 11:43 ` Mauro Carvalho Chehab
2010-09-19 14:58 ` Hans Verkuil
2010-09-19 18:29 ` Mauro Carvalho Chehab
2010-09-19 19:06 ` Hans Verkuil
2010-09-19 20:20 ` Mauro Carvalho Chehab
2010-09-19 21:02 ` Andy Walls
2010-09-19 21:17 ` Hans Verkuil
2010-09-20 0:19 ` Devin Heitmueller
2010-09-19 21:10 ` Hans Verkuil
2010-09-20 2:47 ` Mauro Carvalho Chehab
2010-09-19 19:05 ` Andy Walls
2010-09-19 19:26 ` Mauro Carvalho Chehab
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=4C9651A7.4010707@redhat.com \
--to=mchehab@redhat.com \
--cc=arnd@arndb.de \
--cc=awalls@md.metrocast.net \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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.