Skip to content

Commit

Permalink
PM / runtime: Use pm_runtime_put_sync() in __device_release_driver()
Browse files Browse the repository at this point in the history
Commit fa180eb (PM / Runtime: Idle devices asynchronously after
probe|release) modified __device_release_driver() to call
pm_runtime_put(dev) instead of pm_runtime_put_sync(dev) before
detaching the driver from the device.  However, that was a mistake,
because pm_runtime_put(dev) causes rpm_idle() to be queued up and
the driver may be gone already when that function is executed.
That breaks the assumptions the drivers have the right to make
about the core's behavior on the basis of the existing documentation
and actually causes problems to happen, so revert that part of
commit fa180eb and restore the previous behavior of
__device_release_driver().

Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Fixes: fa180eb (PM / Runtime: Idle devices asynchronously after probe|release)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
  • Loading branch information
Rafael J. Wysocki committed Nov 7, 2013
1 parent d66e6db commit baab52d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ static void __device_release_driver(struct device *dev)
BUS_NOTIFY_UNBIND_DRIVER,
dev);

pm_runtime_put(dev);
pm_runtime_put_sync(dev);

if (dev->bus && dev->bus->remove)
dev->bus->remove(dev);
Expand Down

0 comments on commit baab52d

Please sign in to comment.