alistair23-linux/drivers/base
Rafael J. Wysocki eed5d21507 PM / Runtime: Do not increment device usage counts before probing
The pm_runtime_get_noresume() calls before really_probe() and
before executing __device_attach() for each driver on the
device's bus cause problems to happen if probing fails and if the
driver has enabled runtime PM for the device in its .probe()
callback.  Namely, in that case, if the device has been resumed
by the driver after enabling its runtime PM and if it turns out that
.probe() should return an error, the driver is supposed to suspend
the device and disable its runtime PM before exiting .probe().
However, because the device's runtime PM usage counter was
incremented by the core before calling .probe(), the driver's attempt
to suspend the device will not succeed and the device will remain in
the full-power state after the failing .probe() has returned.

To fix this issue, remove the pm_runtime_get_noresume() calls from
driver_probe_device() and from device_attach() and replace the
corresponding pm_runtime_put_sync() calls with pm_runtime_idle()
to preserve the existing behavior (which is to check if the device
is idle and to suspend it eventually in that case after probing).

Reported-and-tested-by: Kevin Hilman <khilman@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:25:49 -07:00
..
power PM / Sleep: Prevent waiting forever on asynchronous suspend after abort 2012-06-24 23:31:09 +02:00
regmap regmap: Export regmap_reinit_cache() 2012-06-08 05:57:21 +08:00
attribute_container.c
base.h
bus.c driver core: move uevent call to driver_register 2012-07-16 18:04:25 -07:00
class.c Revert "driver core: check start node in klist_iter_init_node" 2012-04-19 19:17:30 -07:00
core.c driver-core: Use kobj_to_dev instead of re-implementing it 2012-07-16 18:05:45 -07:00
cpu.c sched: Remove stale power aware scheduling remnants and dysfunctional knobs 2012-05-17 13:48:56 +02:00
dd.c PM / Runtime: Do not increment device usage counts before probing 2012-07-16 19:25:49 -07:00
devres.c devres: Add devres_release() 2012-05-04 16:33:16 -07:00
devtmpfs.c devtmpfs: fix 'the the' typo 2012-04-18 15:37:35 -07:00
dma-buf.c driver core: fix some kernel-doc warnings in dma*.c 2012-06-14 17:15:26 -07:00
dma-coherent.c driver core: fix some kernel-doc warnings in dma*.c 2012-06-14 17:15:26 -07:00
dma-contiguous.c drivers: add Contiguous Memory Allocator 2012-05-21 15:09:37 +02:00
dma-mapping.c
driver.c driver core: move uevent call to driver_register 2012-07-16 18:04:25 -07:00
firmware.c
firmware_class.c driver-core: Use kobj_to_dev instead of re-implementing it 2012-07-16 18:05:45 -07:00
hypervisor.c
init.c
isa.c
Kconfig drivers: add Contiguous Memory Allocator 2012-05-21 15:09:37 +02:00
Makefile drivers: add Contiguous Memory Allocator 2012-05-21 15:09:37 +02:00
map.c
memory.c
module.c
node.c mm: fix off-by-one bug in print_nodes_state() 2012-05-29 16:22:19 -07:00
platform.c
soc.c mode_t whack-a-mole: ->is_visible() returns umode_t... 2012-05-29 23:28:42 -04:00
syscore.c
topology.c
transport_class.c