diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-12 11:51:48 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 19:25:49 -0700 |
commit | eed5d2150752bd08b22333d739f3120151773d28 (patch) | |
tree | a9bcdd279da2e39951bb588e51f075aa271088c5 /drivers/extcon/extcon-arizona.c | |
parent | eab072609e11a357181806ab5a5c309ef6eb76f5 (diff) | |
download | op-kernel-dev-eed5d2150752bd08b22333d739f3120151773d28.zip op-kernel-dev-eed5d2150752bd08b22333d739f3120151773d28.tar.gz |
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>
Diffstat (limited to 'drivers/extcon/extcon-arizona.c')
0 files changed, 0 insertions, 0 deletions