On Fri, 26 Oct 2007, Johannes Berg wrote: > > > We have two paths here: > > > > > > (a) sysfs write -> lock buffer -> call power management code > > > -> lock pm_mutex > > > (b) boot code -> power management boot -> lock pm_mutex > > > -> use name_to_dev_t() -> call sysfs -> lock buffer > > > > > > As you can see, lockdep rightfully complains about a possible deadlock > > > scenario although of course (b) only happens once at boot at a time > > > where (a) cannot happen. And now we're wondering how to fix it. > > > > Why not use mutex_lock_nested() for the boot-time pm_mutex lock call? > > Is that going to help though? I thought lock_nested() is only for nested > within a class. The "nested" part of the name is a little misleading. The function helps the lockdep core distinguish between locks belonging to the same class. Normally this is be done so that you can nest the locks in the proper order, but that shouldn't stop you from using it here. Alan Stern _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm