On Thursday 04 May 2006 22:16, Johannes Stezenbach wrote: > On Thu, May 04, 2006, Andrew de Quincey wrote: > > Hi, did anyone have any comments on the latest version at > > http://linuxtv.org/hg/~quincy/v4l-dvb-attach > > > > This used module reference counts instead of symbol reference counts, > > avoiding the problems with symbol_put(). > > First, I would like it better if symbol_put_addr() would be fixed > so we could use my dvb_detach() idea ;-) > It would mean that no changes to the frontend drivers are > necessary at all. I suppose Trent's patch to fix it would also provide a good indicator as to whether people think symbol_put_addr() is going to be kept or not, depending on its reception by lkml (or whoever its sent to). The problem then is we then can't use the v4l-dvb drivers on older kernels because they won't have symbol_put_addr() fixed. This isn't an issue for me... but it might be for some people. > Anyway, quoting your patch: > > #define dvb_attach(FUNCTION, ARGS...) ({ \ > > void *__r = NULL; \ > > typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ > > if (__a) { \ > > __r = __a(THIS_MODULE, ARGS); \ > > symbol_put(FUNCTION); \ > > } else printk(KERN_ERR "DVB: Unable to get function "#FUNCTION"()\n"); \ > > __r; \ > > }) > > ... > > > struct dvb_frontend* stv0299_attach(struct module *owner, > > ... > > > state->owner = owner; > > if (owner) > > try_module_get(owner); > > Doesn't this drop the refcount to the frontend module, and > raise the refcount to the card driver? I.e. the frontend > module can be unloaded while it is in use? Arrgh yes :( Dunno what the hell I was thinking! I seem to have made it (a) broken and (b) more complicated - all we would really need to do is increase the refcount on the frontend module - no need to pass module refs about or keep it in the state at all. _______________________________________________ linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb