From patchwork Thu Feb 20 15:31:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3688641 Return-Path: X-Original-To: patchwork-linux-arm@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 566C7BF13A for ; Thu, 20 Feb 2014 16:27:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8220220179 for ; Thu, 20 Feb 2014 16:27:01 +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 7DA402015A for ; Thu, 20 Feb 2014 16:27:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGViF-00081J-MV; Thu, 20 Feb 2014 15:39:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGVcx-0002Uo-Jz; Thu, 20 Feb 2014 15:33:31 +0000 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGVbZ-0002Lv-TB for linux-arm-kernel@lists.infradead.org; Thu, 20 Feb 2014 15:32:07 +0000 Received: by mail-wi0-f170.google.com with SMTP id hi5so744919wib.5 for ; Thu, 20 Feb 2014 07:31:44 -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=D7w1ExdLt8tS5gvAZluupNC02itdzroZGDS8qGFgTiOozjLA+ZOsBr1mFP2rG9pQjD gy4Xvfk+8w8Q8KOJlCD+uq0JS50V4p40HQc9gTzTbe01ceIlUOZL5H20VgHaNv6Br6mw sNoO9zweyXPj6jVlP/n1mUuoCRrH9UUo28zLk2MhRY856vI5vvHXQ4Ze3negarJjY3+Q 6Orkf1i3kIlvBcEbNUj64XPlom6IK9o2Pk/49xmrDmz/OXwl3YbEZuCpJCPsBP1V02iA oOr0B91LxCJJbr7H93+p4HYbGPQw3k4kxD+0RSQn/8d8Ejq683lpVMASwcPBAeU8gQOz rTPQ== X-Gm-Message-State: ALoCoQlmFqoPD7/0odqShdC3LeL4yC+Vrn1vUwY2Gj//9c5NKH5pkMReXXGtBEhA8G+n7IGG1/Pv X-Received: by 10.194.173.163 with SMTP id bl3mr2578253wjc.73.1392910304159; Thu, 20 Feb 2014 07:31:44 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id h9sm9719799wjz.16.2014.02.20.07.31.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 07:31:43 -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: Thu, 20 Feb 2014 16:31:20 +0100 Message-Id: <1392910280-12891-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392910280-12891-1-git-send-email-ulf.hansson@linaro.org> References: <1392910280-12891-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140220_103206_102019_65DE7241 X-CRM114-Status: GOOD ( 14.14 ) X-Spam-Score: 0.4 (/) Cc: Ulf Hansson , Kevin Hilman , Russell King , Wolfram Sang , Linus Walleij , Mark Brown , Alan Stern , 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.8 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) };