Skip to content

Commit

Permalink
PM / Runtime: fix recursive locking warning of lockdep from rpm_resume()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ming Lei authored and Rafael J. Wysocki committed Oct 22, 2010
1 parent 9c03439 commit d63be5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/power/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d63be5f

Please sign in to comment.