Patchwork [TRUSTY] PM / hibernate: Fix restore hang in freeze_processes()

login
register
mail settings
Submitter Colin King
Date March 4, 2014, 3:48 p.m.
Message ID <1393948108-832-2-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/326370/
State New
Headers show

Comments

Colin King - March 4, 2014, 3:48 p.m.
From: Sebastian Capella <sebastian.capella@linaro.org>

During restore, pm_notifier chain are called with
PM_RESTORE_PREPARE.  The firmware_class driver handler
fw_pm_notify does not have a handler for this.  As a result,
it keeps a reader on the kmod.c umhelper_sem.  During
freeze_processes, the call to __usermodehelper_disable tries to
take a write lock on this semaphore and hangs waiting.

Signed-off-by: Sebastian Capella <sebastian.capella@linaro.org>
Acked-by: Ming Lei <ming.lei@canonical.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit f8d5b9e9e5372f0deb7bc1ab1088a9b60b0a793d)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/base/firmware_class.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index eb8fb94..e2b51f8 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1541,6 +1541,7 @@  static int fw_pm_notify(struct notifier_block *notify_block,
 	switch (mode) {
 	case PM_HIBERNATION_PREPARE:
 	case PM_SUSPEND_PREPARE:
+	case PM_RESTORE_PREPARE:
 		kill_requests_without_uevent();
 		device_cache_fw_images();
 		break;