]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
drivercore: Fix ordering between deferred_probe and exiting initcalls
authorGrant Likely <grant.likely@secretlab.ca>
Thu, 14 Feb 2013 18:14:27 +0000 (18:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2013 13:38:32 +0000 (05:38 -0800)
commit4469887f863aa5348cc95b77a6e4b1e83a7fc6cd
treeb32231641089e2f0536edf5138a9d3a9daa1ee2b
parentbb01afe62feca1e7cdca60696f8b074416b0910d
drivercore: Fix ordering between deferred_probe and exiting initcalls

commit d72cca1eee5b26e313da2a380d4862924e271031 upstream.

One of the side effects of deferred probe is that some drivers which
used to be probed before initcalls completed are now happening slightly
later. This causes two problems.
- If a console driver gets deferred, then it may not be ready when
  userspace starts. For example, if a uart depends on pinctrl, then the
  uart will get deferred and /dev/console will not be available
- __init sections will be discarded before built-in drivers are probed.
  Strictly speaking, __init functions should not be called in a drivers
  __probe path, but there are a lot of drivers (console stuff again)
  that do anyway. In the past it was perfectly safe to do so because all
  built-in drivers got probed before the end of initcalls.

This patch fixes the problem by forcing the first pass of the deferred
list to complete at late_initcall time. This is late enough to catch the
drivers that are known to have the above issues.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dd.c