diff options
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r-- | kernel/power/disk.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 8b15f777010a..05b64790fe83 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -456,7 +456,17 @@ static int software_resume(void) | |||
456 | int error; | 456 | int error; |
457 | unsigned int flags; | 457 | unsigned int flags; |
458 | 458 | ||
459 | mutex_lock(&pm_mutex); | 459 | /* |
460 | * name_to_dev_t() below takes a sysfs buffer mutex when sysfs | ||
461 | * is configured into the kernel. Since the regular hibernate | ||
462 | * trigger path is via sysfs which takes a buffer mutex before | ||
463 | * calling hibernate functions (which take pm_mutex) this can | ||
464 | * cause lockdep to complain about a possible ABBA deadlock | ||
465 | * which cannot happen since we're in the boot code here and | ||
466 | * sysfs can't be invoked yet. Therefore, we use a subclass | ||
467 | * here to avoid lockdep complaining. | ||
468 | */ | ||
469 | mutex_lock_nested(&pm_mutex, SINGLE_DEPTH_NESTING); | ||
460 | if (!swsusp_resume_device) { | 470 | if (!swsusp_resume_device) { |
461 | if (!strlen(resume_file)) { | 471 | if (!strlen(resume_file)) { |
462 | mutex_unlock(&pm_mutex); | 472 | mutex_unlock(&pm_mutex); |