[linux-dvb] idea on how to break the static dependencies on demodulator modules

Johannes Stezenbach js at linuxtv.org
Tue May 16 15:54:53 CEST 2006


On Tue, May 16, 2006, Andrew de Quincey wrote:
> On Tuesday 16 May 2006 12:25, Johannes Stezenbach wrote:
> > IOW, chaining ->release() is not the problem, but having
> > ->release() decrement the refcount of some other module is.
> 
> Hmm, sorry, not sure what you mean here - where is one module decrementing the 
> refcount of another module? Ah, do you mean the symbol_put in the current  
> dvb_attach() ?

Sorry, you published your current idea as a patch against an
ill-conceived, discarded idea. This makes it very hard to read.
http://linuxtv.org/hg/~quincy/v4l-dvb-attach

For discussion it would be *much* better to have a small patch
against current mainline which just does the core changes plus
one or two example demod driver changes.

Anyway:

dvb_unregister_frontend():
...

+ 	while(fe->ops->release) {
+ 		struct module *m = fe->ops->release(fe);
+ 		if (m)
+ 			module_put(m);
+ 	}
+

- this way of chaining release() looks just sick
  (is it even legal C code? can the optimizer not optimize
  away the fe->ops->release register reload and turn this
  into an endless loop?)
- the module_put() in there is just as wrong as doing
  the module_put() inside release()


Really, the more I think about it, this whole chaining idea
is garbage. Better change lnbp21.



Johannes



More information about the linux-dvb mailing list