]> err.no Git - linux-2.6/blobdiff - kernel/power/disk.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
[linux-2.6] / kernel / power / disk.c
index 8b15f777010a9daefe2361adfbf5c1c0851dfb75..05b64790fe8391ed5189eee02144e5cf63f3fa2b 100644 (file)
@@ -456,7 +456,17 @@ static int software_resume(void)
        int error;
        unsigned int flags;
 
-       mutex_lock(&pm_mutex);
+       /*
+        * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
+        * is configured into the kernel. Since the regular hibernate
+        * trigger path is via sysfs which takes a buffer mutex before
+        * calling hibernate functions (which take pm_mutex) this can
+        * cause lockdep to complain about a possible ABBA deadlock
+        * which cannot happen since we're in the boot code here and
+        * sysfs can't be invoked yet. Therefore, we use a subclass
+        * here to avoid lockdep complaining.
+        */
+       mutex_lock_nested(&pm_mutex, SINGLE_DEPTH_NESTING);
        if (!swsusp_resume_device) {
                if (!strlen(resume_file)) {
                        mutex_unlock(&pm_mutex);