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

Andrew de Quincey adq_dvb at lidskialf.net
Tue Apr 18 13:05:35 CEST 2006

On Tuesday 18 April 2006 11:37, Johannes Stezenbach wrote:
> On Tue, Apr 18, 2006, Andrew de Quincey wrote:
> > These use symbol_get() to dynamically get the address of the XXX_attach()
> > method and, if found, call it. Otherwise they fake a NULL return, and the
> > normal frontend failure code comes into effect.
> ...
> > Can anyone see anything fundamentally wrong with doing it this way? Due
> > to the frontend refactoring a while back, we already have these nice
> > tables of function pointers everywhere anyway.
> Sorry, I think it is a bad idea because it is not user friendly.
> Normal people are challenged enough to find out which driver
> to use for their card (especially true for budget vs. budget-ci
> vs. budget-av).
> The static dependencies on the frontend drivers ensures that
> the necessary frontend drivers for all card variants are loaded,
> without users having to worry about that.
> The price to pay is a few K of wasted RAM, IMHO totally
> insignificant compared to the MBytes of buffer space
> some cards allocate.

I don't see this problem: By default all frontends would be turned on in the 
Kconfig but not loaded. DVB_ATTACH() will then automatically request_module() 
the modules it needs into memory. 

Advanced users who really want to customise the frontends to be compiled can 
deselect those they don't need. People who dont care just leave it as it is; 
all frontends get compiled, but only a few will be loaded.

> OK, in case I can't talk you out of this, what you need to do
> is to pull the probe code out of the demod drivers and create
> frontends/probe.c. Then after probing you can request_module()
> the necessary modules.
> (I think this implies that it can't be done from a module_init()
> function, which I think isn't a problem for PCI or USB drivers,
> but could create headaches for embedded platforms. But please
> check, I'm not sure about this.)
> Also, it means that the Kconfig will still have to have the
> frontend dependencies. You could add a "[x] manual frontend
> selection for DVB experts", though.

Why is this better than loading them during the probe itself? Surely the same 
problem arises; people can turn off compilation of frontends so it can't 
request_module() them?

> About symbol_get(): Since there only two users in the
> whole kernel, I recommend you check with akpm and lkml first
> before you base your work on it.

Yeah, good point.

More information about the linux-dvb mailing list