Re: Initcall / device model meltdown?

Jeff Garzik (jgarzik@pobox.com)
Fri, 17 Jan 2003 14:32:56 -0500


On Fri, Jan 17, 2003 at 07:23:56PM +0000, Russell King wrote:
> 1. the device model requires a certain initialisation order.
> 2. modules need to use module_init() which means the initialisation order
> is link-order dependent, despite our multi-level initialisation system.
>
> Obviously one solution would be to spread the drivers for this
> multifunction chip throughout the kernel tree (ie, by function not
> by device) so the touchscreen driver would live under drivers/input.
>
> However, then we need to make sure that the multifunction chip's
> bus type is initialised before any of the other subsystems, and of
> course, the bus type is initialised using module_init() since it
> lives in a module...
>
> I think we need to re-think what we're doing with the initialisation
> handling and the device model before these sorts of problems get out
> of hand.

IMO this link order business is a problem that's existed for ages,
it's unrelated to the device model, and adding seven levels of
initcalls merely hid this problem a little bit.

Back when I was doing fbdev stuff, I just gave up and did things "the
old way", a la

#ifdef MODULE
module_init(my_driver);
#endif

and then call my_driver from other code, when it is built into the
kernel, overriding link order.

Not a great solution, I know. My preferred solution has always been to
explicitly list the dependencies, so a build-time tool can figure out
the link order automagically.

Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/