From patchwork Wed Feb 19 01:52:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Capella X-Patchwork-Id: 3677551 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5E88BBF13A for ; Wed, 19 Feb 2014 01:52:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 800992018E for ; Wed, 19 Feb 2014 01:52:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A221A201DE for ; Wed, 19 Feb 2014 01:52:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544AbaBSBwy (ORCPT ); Tue, 18 Feb 2014 20:52:54 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:55070 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbaBSBwW (ORCPT ); Tue, 18 Feb 2014 20:52:22 -0500 Received: by mail-pd0-f178.google.com with SMTP id fp1so8385334pdb.9 for ; Tue, 18 Feb 2014 17:52:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FrKhD+9eDvs7keURZEt0VpElgdIkqAxUHQ3Faoy4ZFg=; b=I1nOYth31BwzDN2qUvd0yW331I3ddJArKjlHIn4LmM7Dumer7KDDcOZWXy4HzAiNUI 7f7UAbtIFsWhc2L91lHefLp8YJa4mDxJrEDbo8yneLoEIyehRVetby6/SiA7qAA7uLKS quzO5NLe5ZKNEkKdgQsrtxg4sy3HjYQFbmadixACRC+3OOQtQHDNQCU23FCAjgIga4gv YhXSuX1jtATUu/6PiaHyrGY5+TELMK3r3JtCLLL4XP96hLuNsA6ztUyhAeJhd/H/wOF3 3n/cRxv3sHqOlcvEv8HIkbFIFNz6ZK0q8uV76sc2k6oAjt/jnRswfOfA+ONOESM91RzX GnCw== X-Gm-Message-State: ALoCoQnNXmphaUSAJQ8z3c/8ZsL8RBrGlgKOvPAwxvC84HN5h1s5WAsIfD6Saz+lqbE7bPH3zMGl X-Received: by 10.68.98.3 with SMTP id ee3mr36926450pbb.31.1392774741753; Tue, 18 Feb 2014 17:52:21 -0800 (PST) Received: from localhost (cpe-76-93-135-111.san.res.rr.com. [76.93.135.111]) by mx.google.com with ESMTPSA id e6sm60467550pbg.4.2014.02.18.17.52.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Feb 2014 17:52:20 -0800 (PST) From: Sebastian Capella To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Sebastian Capella , Russ Dill , Ming Lei , Greg Kroah-Hartman Subject: [PATCH RFC v1 2/3] Fix hibernation restore hang in freeze_processes Date: Tue, 18 Feb 2014 17:52:08 -0800 Message-Id: <1392774729-3235-3-git-send-email-sebastian.capella@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392774729-3235-1-git-send-email-sebastian.capella@linaro.org> References: <1392774729-3235-1-git-send-email-sebastian.capella@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Russ Dill Cc: Ming Lei Cc: Greg Kroah-Hartman Acked-by: Ming Lei --- drivers/base/firmware_class.c | 1 + 1 file changed, 1 insertion(+) 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;