]> Git Repo - linux.git/commitdiff
PM / Runtime: fix recursive locking warning of lockdep from rpm_resume()
authorMing Lei <[email protected]>
Fri, 22 Oct 2010 21:48:14 +0000 (23:48 +0200)
committerRafael J. Wysocki <[email protected]>
Fri, 22 Oct 2010 21:48:14 +0000 (23:48 +0200)
For device with no_callbacks flag set, its power lock and its parent's
power lock may be held nestedly in rpm_resume, so we should take
spin_lock_nested(lock, SINGLE_DEPTH_NESTING) to acquire parent power lock
to avoid lockdep warning.

Signed-off-by: Ming Lei <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/base/power/runtime.c

index 1dd8676d7f55705a84ad26ff77544b0518c02723..126ca492dd08fe3694f0e78d823bbb8ec6a692b1 100644 (file)
@@ -503,7 +503,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
         * the resume will actually succeed.
         */
        if (dev->power.no_callbacks && !parent && dev->parent) {
-               spin_lock(&dev->parent->power.lock);
+               spin_lock_nested(&dev->parent->power.lock, SINGLE_DEPTH_NESTING);
                if (dev->parent->power.disable_depth > 0
                    || dev->parent->power.ignore_children
                    || dev->parent->power.runtime_status == RPM_ACTIVE) {
This page took 0.058291 seconds and 4 git commands to generate.