Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: [PATCH] Lock adapter modules when devices are open



Jon Burgess wrote:
> Johannes Stezenbach wrote:
> 
> >I just gave it a try with 2.4 and it didn't work. I was able
> >to unload dvb-ttpci while szap was running, resulting in an
> >Oops when I interrupted szap.
> 
> I did testing on both 2.4 and 2.6 with two budget Nova-T cards. I'm sure 
> I tried doing the same thing with tzap and it worked OK.

I have a dvb-ttpci: Siemens cable card PCI rev1.5 and a
dvb-ttpci: Siemens/Technotrend/Hauppauge PCI rev1.3.

> I assume that when you did the test you did remove and reload all the 
> dvb modules, including dvb-core?

I just unloaded dvb-ttpci.

> The locking is done by the try_module_get() in the generic dvb-core 
> open() file operation, so I don't see how it can not get called when the 
> device node gets opened. A couple of printk's should show whether the 
> code gets run and whether the module pointer is set to something valid.
> Perhaps adding a debug print of the module name would be appropriate.
> 
> The other possibility is that is locking the wrong module.
> 
> It looks like the dvb-ttpci module statically links the av7110 code, 
> which should provide the correct module reference when it calls 
> dvb_register_adapter().
> 
> The budget driver is divided into a common budget-core module and a card 
> specific budget driver. It is the budget-core which does the 
> dvb_register_adapter() call, but the budget driver which needs to get 
> locked. I have to pass the module pointer from the budget driver to the 
> budget-core.

I applied your debug patch (with:
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
  static inline const char *module_name(struct module *mod)
  {
	return mod->name;
  }
  #endif
)

I see that the "DVB: Device opened, locking module" messages does not
happen, just the "DVB: Device closed, unlocking module dvb-ttpci".
After a bit of szap/scan exercise, lsmod reports:

Module                  Size  Used by    Not tainted
dvb-ttpci             288212 -48  (unused)

Bad.


Johannes


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index