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

Markus Rechberger mrechberger at gmail.com
Fri Aug 17 22:26:05 CEST 2007


On 8/17/07, Andreas Oberritter <obi at linuxtv.org> wrote:
> Hi Oliver,
>
> Oliver Endriss wrote:
> > ts_bus_ctrl does a kind of reference counting.
> >
> > For readers:
> > - fe->ops.ts_bus_ctrl(fe,1) is called during open
> > - fe->ops.ts_bus_ctrl(fe,0) is called during close
> >
> > For the one and only writer:
> > - fe->ops.ts_bus_ctrl(fe,1) is called during open
> > - fe->ops.ts_bus_ctrl(fe,0) is called when the thread exits,
> >   usually after close
>
> To properly lock the bridge, fe->ops.ts_bus_ctrl(fe, 1) must be called
> only when the first user opens the device and fe->ops.ts_bus_ctrl(fe, 0)
> must be called only when the last user closes the device.
>

I didn't want to write it but this is also what I would do, and I
would also include the other dvb device nodes.. it doesn't make sense
to keep them open as non functional dummies, or even allow people to
open these nodes if the dvb mode is locked.

> I think that the option dvb_shutdown_timeout must be removed to fix the
> problem, where the frontend thread can be idle after close(). IMHO the
> thread should always be terminated when the last writer closes the
> device. The release function should then block until the thread really
> has terminated.

yes, there's nothing else to say here.

Markus



More information about the linux-dvb mailing list