From d63be5f924cf054e7ac18bb2761f9533039fb076 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Fri, 22 Oct 2010 23:48:14 +0200 Subject: [PATCH] PM / Runtime: fix recursive locking warning of lockdep from rpm_resume() 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 Acked-by: Alan Stern Signed-off-by: Rafael J. Wysocki --- drivers/base/power/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 1dd8676..126ca49 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -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) { -- 2.7.4