[linux-dvb] [PATCH] add device node locking possibility to dvbcore

Markus Rechberger mrechberger at gmail.com
Sat Aug 11 10:02:53 CEST 2007


On 8/11/07, Trent Piepho <xyzzy at speakeasy.org> wrote:
> On Thu, 9 Aug 2007, Markus Rechberger wrote:
> > On 8/9/07, Markus Rechberger <mrechberger at gmail.com> wrote:
> > > On 8/9/07, Steven Toth <stoth at hauppauge.com> wrote:
> > > > Markus Rechberger wrote:
> > > > > Following patch adds a rather primitive way to temporary lock dvb
> > > > > devicenodes, this can be useful for hybrid devices which use the
> > > > > video4linux framework for the analogue TV part and the dvb framework
> for
> > > > > digital TV if only one mode can be accessed at a time.
> > > > >
> > >
> >
> > I  want to allow a user to use one mode at a time, so either DVB or V4L.
> > The device requires a different firmware for V4L and DVB also
> > different GPIO values and some special register writes.
>
> This code looks like it's full of race conditions.  How do you prevent the
> dvb
> code and the v4l code from accessing the lock field at the same time?  For
> example, in your em28xx code, what happens if the dvb devices is opened
> after
> the call to ->get_status on line 230 and before the call to ->dvb_lock on
> line
> 234?
>

Well it's a primitive lock, a lock could be added for atomical
operations. Even though I do not expect that any user would be able to
trigger a race condition there.

> Why do you need to add locks to the frontend, dvr, demux, and net devices?
> Is
> it necessary to lock anything besides the frontend?
>

I intended to lock the whole DTV part, it doesn't work if ATV is used.

> Some devices, like the demux device, are multiple open.  How do you know
> when
> to lock and unlock them?
>

by checking the usercounters when someone tries to open the ATV devicenodes.

Markus



More information about the linux-dvb mailing list