aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/runtime.c
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2010-10-22 17:48:14 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2010-10-22 17:48:14 -0400
commitd63be5f924cf054e7ac18bb2761f9533039fb076 (patch)
tree6db8b10599ad992de452f7b6193e02c75c9296e3 /drivers/base/power/runtime.c
parent9c034392533f3e9f00656d5c58478cff2560ef81 (diff)
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 <tom.leiming@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base/power/runtime.c')
-rw-r--r--drivers/base/power/runtime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 1dd8676d7f55..126ca492dd08 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)
503 * the resume will actually succeed. 503 * the resume will actually succeed.
504 */ 504 */
505 if (dev->power.no_callbacks && !parent && dev->parent) { 505 if (dev->power.no_callbacks && !parent && dev->parent) {
506 spin_lock(&dev->parent->power.lock); 506 spin_lock_nested(&dev->parent->power.lock, SINGLE_DEPTH_NESTING);
507 if (dev->parent->power.disable_depth > 0 507 if (dev->parent->power.disable_depth > 0
508 || dev->parent->power.ignore_children 508 || dev->parent->power.ignore_children
509 || dev->parent->power.runtime_status == RPM_ACTIVE) { 509 || dev->parent->power.runtime_status == RPM_ACTIVE) {