From patchwork Mon Aug 25 12:26:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 4774141 Return-Path: X-Original-To: patchwork-linux-sh@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 47CD5C0338 for ; Mon, 25 Aug 2014 12:28:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7AE762010B for ; Mon, 25 Aug 2014 12:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7715A200D6 for ; Mon, 25 Aug 2014 12:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932511AbaHYM2E (ORCPT ); Mon, 25 Aug 2014 08:28:04 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:37524 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932380AbaHYM0m (ORCPT ); Mon, 25 Aug 2014 08:26:42 -0400 Received: by mail-we0-f174.google.com with SMTP id x48so13225088wes.19 for ; Mon, 25 Aug 2014 05:26:41 -0700 (PDT) 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=aLK+vH6H0nkcg9hWQ1V9i8EEcLCr2iSaUxzmiP5NbzI=; b=d2sv9cmewHCgFZ23Rxa6slfA+RYjIeUPslGfHxrrQOD2zSoEoL1uwwzzbsoHBXwd6t S4dZ0pYzrjdvWx5yUBbp7WpN7LOnqiXwdQnYTWRQhflJke+xaFApDOyqvNA9IIxcMrry Z4IKerZrzY/OF1L3d1qniVwKdpmJW1S1kOVORIXREUzztkCsZfyt1tzSj/5S4C/7Onvh dww5ygdexYyg3mXAOY7+WAP+GeDDNtPrrOQfD9dCrGqGH1mUoFiB5MCRhr2EUU7sCjCb 2PHt74p2kt0WZwPZ5oPp/6ryYBFpz6V3S2xJehqfhcfnpMEBaJoaikMQnahIipFZPxQi /ZDA== X-Gm-Message-State: ALoCoQkX2Qc00hssimKDSzXqnfx1DJ2s1WRKKFuTtWCSNMim/QvV6/ZdK+7fYEqrj+w68yi1L1Ue X-Received: by 10.180.101.129 with SMTP id fg1mr14948283wib.20.1408969601384; Mon, 25 Aug 2014 05:26:41 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id u5sm145337wia.17.2014.08.25.05.26.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Aug 2014 05:26:40 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ian Molton , Chris Ball Cc: Geert Uytterhoeven , Linux-sh list , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH 11/12] mmc: tmio_mmc: Fixup system PM suspend lock-up Date: Mon, 25 Aug 2014 14:26:03 +0200 Message-Id: <1408969564-6335-12-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408969564-6335-1-git-send-email-ulf.hansson@linaro.org> References: <1408969564-6335-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 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 At system PM suspend, the tmio core accessed the internal registers of the controller without first moving the device into active state. This caused a lock-up in system PM suspend phase. The reason for the register access were masking of IRQs. Since that is managed via the runtime PM suspend path, let's just re-use that path for system PM suspend. In other words force the device into runtime PM suspend state at system PM suspend and restore it to active state at system PM resume. Reported-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson --- drivers/mmc/host/tmio_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 58f50ef..659028d 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -30,7 +30,7 @@ static int tmio_mmc_suspend(struct device *dev) const struct mfd_cell *cell = mfd_get_cell(pdev); int ret; - ret = tmio_mmc_host_suspend(dev); + ret = pm_runtime_force_suspend(dev); /* Tell MFD core it can disable us now.*/ if (!ret && cell->disable) @@ -50,7 +50,7 @@ static int tmio_mmc_resume(struct device *dev) ret = cell->resume(pdev); if (!ret) - ret = tmio_mmc_host_resume(dev); + ret = pm_runtime_force_resume(dev); return ret; }