public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Initcall / device model meltdown?
@ 2003-01-17 19:23 Russell King
  2003-01-17 19:32 ` Jeff Garzik
  2003-01-17 19:56 ` Kai Germaschewski
  0 siblings, 2 replies; 5+ messages in thread
From: Russell King @ 2003-01-17 19:23 UTC (permalink / raw)
  To: linux-kernel

The initcall/device model seems to be quite fragile at the moment with
respect to not oopsing the kernel.

On many StrongARM-based systems, a multifunction chip addressed through
a serial bus is used to provide touchscreen, audio and additional digital
IO.  Currently, there are many sub-drivers, some of which are modular
themselves, and some which depend on each other.  They currently live
under drivers/misc, for want of a better location.  They are all
initialised using module_init(), via the device model driver_register()
function.

The input drivers are also modular, and provide a device class
(input_devclass), which is registered using module_init().

One of the multifunction device drivers is a touchscreen driver, which
should obviously be part of the input device class.

Both the input core and the multifunction chip drivers are using
module_init(), the order in which these are initialised is link-order
specific, and it happens that drivers/input is initialised really late
during boot, after drivers/misc.

Since the device model requires any object to be initialised before it
is used, this causes an oops from devclass_add_driver().

We appear to have two conflicting requirements here:

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.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-01-17 20:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-17 19:23 Initcall / device model meltdown? Russell King
2003-01-17 19:32 ` Jeff Garzik
     [not found]   ` <3104.1042835842@www5.gmx.net>
2003-01-17 20:48     ` Dominik Brodowski
2003-01-17 19:56 ` Kai Germaschewski
2003-01-17 20:14   ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox