From patchwork Sat Mar 1 10:56:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3746821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B9049F381 for ; Sat, 1 Mar 2014 11:27:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BB4A2034B for ; Sat, 1 Mar 2014 11:27:13 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 400E72034A for ; Sat, 1 Mar 2014 11:27:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJhcl-0006iT-Ok; Sat, 01 Mar 2014 10:58:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJhc1-0007Z8-Fy; Sat, 01 Mar 2014 10:57:45 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJhbG-0007Ql-Az for linux-arm-kernel@lists.infradead.org; Sat, 01 Mar 2014 10:56:59 +0000 Received: by mail-lb0-f171.google.com with SMTP id w7so3396465lbi.2 for ; Sat, 01 Mar 2014 02:56:36 -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=v0MhzivUWFlnHH6kyoBYyzrEtR9SSeDt19olQP8UY/k=; b=OpgrTkBQTxg3tNs0xQHuPnBNW1Yetf51lrk8SpDQkylOpcDT2KFOkL4qSpmYM7njRf 4j9SUa3zvv+VMzUK8HZKRJb2YQBIDdvILqbLc+8kQxQ7UZ6M8dXmi6jijjlXzFC8iS7C WCP17NisucJukspxVG5H+glLGGC688a1q1IOBvnuFWRXlZgdOGfZ92fmccxFdvAQOYTu pJ9Xe9zJAkX/Y1Lx4hD+9+LC9LFeplQ66mn/c7jux4bCLE8739tOFUqc9AMmHxMWfivW O/i92UzDtwuQP1eBN2pP7wFA0P8QyxnnmCje8cOt4P2ERPqS3kKPYPDUzPhEpCxFEWWG EJ+Q== X-Gm-Message-State: ALoCoQlwi5rCBNOT6w7sEqxS5+OI7EDRmQ5S/zp7qs5/Kk1z3bINmXzbR0Kc36OsYS8kJTA3F3Xz X-Received: by 10.152.6.101 with SMTP id z5mr930164laz.53.1393671396053; Sat, 01 Mar 2014 02:56:36 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id qf1sm4532484lbc.8.2014.03.01.02.56.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 02:56:35 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Subject: [PATCH 8/8] mmc: mmci: Put the device into low power state at system suspend Date: Sat, 1 Mar 2014 11:56:11 +0100 Message-Id: <1393671371-2398-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393671371-2398-1-git-send-email-ulf.hansson@linaro.org> References: <1393671371-2398-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140301_055658_570679_FF7D6F45 X-CRM114-Status: GOOD ( 13.10 ) X-Spam-Score: 0.5 (/) Cc: Ulf Hansson , Kevin Hilman , Russell King , Wolfram Sang , Greg Kroah-Hartman , Linus Walleij , Mark Brown , Alan Stern , Josh Cartwright , linux-arm-kernel@lists.infradead.org, Alessandro Rubini X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 For CONFIG_PM_SLEEP, the device were always left in full power state after system suspend. We solely relied on a power domain to put it into low power state, which is an unreasonable requirement to put on SOCs to implement. Especially for those SOCs not supporting power domains at all. Use pm_runtime_force_suspend|resume() as the system suspend callbacks, to resolve the issue. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index c88da1c..1432ae2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1723,36 +1723,6 @@ static int mmci_remove(struct amba_device *dev) return 0; } -#ifdef CONFIG_SUSPEND -static int mmci_suspend(struct device *dev) -{ - struct amba_device *adev = to_amba_device(dev); - struct mmc_host *mmc = amba_get_drvdata(adev); - - if (mmc) { - struct mmci_host *host = mmc_priv(mmc); - pm_runtime_get_sync(dev); - writel(0, host->base + MMCIMASK0); - } - - return 0; -} - -static int mmci_resume(struct device *dev) -{ - struct amba_device *adev = to_amba_device(dev); - struct mmc_host *mmc = amba_get_drvdata(adev); - - if (mmc) { - struct mmci_host *host = mmc_priv(mmc); - writel(MCI_IRQENABLE, host->base + MMCIMASK0); - pm_runtime_put(dev); - } - - return 0; -} -#endif - #ifdef CONFIG_PM static void mmci_save(struct mmci_host *host) { @@ -1820,7 +1790,8 @@ static int mmci_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops mmci_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(mmci_suspend, mmci_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) };