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

Andreas Oberritter obi at linuxtv.org
Fri Aug 17 22:20:42 CEST 2007


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 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.

Regards,
Andreas



More information about the linux-dvb mailing list