Re: [PATCH] driver core: add wait event for deferred probe

From: Russell King - ARM Linux
Date: Thu Feb 14 2013 - 05:05:33 EST


On Thu, Feb 14, 2013 at 09:56:36AM +0000, Arnd Bergmann wrote:
> I would put it this way: With the introduction of deferred probing, the
> rules for the use of __init sections have changed slightly for some
> corner cases. While normal device drivers can, as before, not call
> __init functions from their .probe() callbacks, we could do that in
> drivers as long as they were built-in and did not support hotplug,
> and that exception was used in console drivers. This exception has
> now become more specific, and those drivers also must not use
> deferred probing that depends on other loadable modules or hotpluggable
> devices.

In the general case, that remains true, but it's still _not_ true for
console drivers.

The console _should_ be initialised before it is attempted to be opened
before passing control to userspace, which happens before the .init
section is freed.

If the console is deferred past that point, then userspace has no console.
The behaviour of userspace in that situation can be very interesting, and
I'd suggest that such is not well tested; consider the effect of not
having fd 0,1,2 connected to something like a console but your filesystem
and something doing a printf(). You can hope that userspace will take
care of that condition, but I personally would not put much faith in it.

With the plethora of 'init' daemon solutions we now have, I have less
faith than I used to that such a condition would be correctly handled
by all of them.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/