1
0
Fork 0
alistair23-linux/drivers/base
Grant Likely d1c3414c2a drivercore: Add driver probe deferral mechanism
Allow drivers to report at probe time that they cannot get all the resources
required by the device, and should be retried at a later time.

This should completely solve the problem of getting devices
initialized in the right order.  Right now this is mostly handled by
mucking about with initcall ordering which is a complete hack, and
doesn't even remotely handle the case where device drivers are in
modules.  This approach completely sidesteps the issues by allowing
driver registration to occur in any order, and any driver can request
to be retried after a few more other drivers get probed.

v4: - Integrate Manjunath's addition of a separate workqueue
    - Change -EAGAIN to -EPROBE_DEFER for drivers to trigger deferral
    - Update comment blocks to reflect how the code really works
v3: - Hold off workqueue scheduling until late_initcall so that the bulk
      of driver probes are complete before we start retrying deferred devices.
    - Tested with simple use cases.  Still needs more testing though.
      Using it to get rid of the gpio early_initcall madness, or to replace
      the ASoC internal probe deferral code would be ideal.
v2: - added locking so it should no longer be utterly broken in that regard
    - remove device from deferred list at device_del time.
    - Still completely untested with any real use case, but has been
      boot tested.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dilan Lee <dilee@nvidia.com>
Cc: Manjunath GKondaiah <manjunath.gkondaiah@linaro.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: David Daney <david.daney@cavium.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:53:13 -08:00
..
power PM / Domains: Skip governor functions for CONFIG_PM_RUNTIME unset 2012-01-14 00:39:36 +01:00
regmap regmap: Reset cache status when reinitialsing the cache 2012-01-20 13:49:30 +00:00
Kconfig drivers/base: add bus for System-on-Chip devices 2012-02-10 11:42:25 -08:00
Makefile drivers/base: add bus for System-on-Chip devices 2012-02-10 11:42:25 -08:00
attribute_container.c [SCSI] attirbute_container: Initialize sysfs attributes with sysfs_attr_init 2010-03-27 15:15:24 -04:00
base.h drivercore: Add driver probe deferral mechanism 2012-03-08 11:53:13 -08:00
bus.c Merge 3.3-rc2 into the driver-core-next branch. 2012-02-02 11:24:44 -08:00
class.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
core.c drivercore: Add driver probe deferral mechanism 2012-03-08 11:53:13 -08:00
cpu.c CPU: Introduce ARCH_HAS_CPU_AUTOPROBE and X86 parts 2012-01-26 16:49:08 -08:00
dd.c drivercore: Add driver probe deferral mechanism 2012-03-08 11:53:13 -08:00
devres.c devres: Fix a typo in devm_kfree comment 2011-12-21 00:31:47 +01:00
devtmpfs.c Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-01-08 12:19:57 -08:00
dma-buf.c dma-buf: Introduce dma buffer sharing mechanism 2012-01-06 10:20:21 +00:00
dma-coherent.c drivers/base: dma-coherent.c is a module and needs module.h 2011-10-31 19:31:38 -04:00
dma-mapping.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
driver.c Eliminate get_driver() and put_driver() 2012-01-24 16:00:36 -08:00
firmware.c firmware: change firmware_kset to firmware_kobj 2008-01-24 20:40:23 -08:00
firmware_class.c PM / Sleep: Fix read_unlock_usermodehelper() call. 2012-01-23 21:59:08 +01:00
hypervisor.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
init.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
isa.c dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) 2009-04-07 08:31:12 -07:00
map.c [PATCH] kobj_map semaphore to mutex conversion 2006-03-20 13:42:58 -08:00
memory.c kdump: add udev events for memory online/offline 2012-01-12 20:13:11 -08:00
module.c driver core: module.c: Use kasprintf 2010-05-21 09:37:29 -07:00
node.c Merge branch 'driver-core-next' into Linux 3.2 2012-01-06 11:42:52 -08:00
platform.c Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 2012-01-08 13:10:57 -08:00
soc.c drivers/base: add bus for System-on-Chip devices 2012-02-10 11:42:25 -08:00
syscore.c PM: Reintroduce dropped call to check_wakeup_irqs 2011-07-11 10:51:49 +02:00
topology.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
transport_class.c drivers/base: transport_class explicitly requires EXPORT_SYMBOL 2011-10-31 19:31:15 -04:00