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: 25574 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CEF6206A6 for ; Sat, 1 Mar 2014 10:56:38 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf10164547ykr.2 for ; Sat, 01 Mar 2014 02:56:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=v0MhzivUWFlnHH6kyoBYyzrEtR9SSeDt19olQP8UY/k=; b=jZ+aHY6dNj4n0kaGD4qBsS1p6dh+oUMQnoQGzMw+lZ5TDbzTU/Ie0BvH2CZVQnU83M rtWJoP/WSvIxafSMhi4bGQHFcQCZ6ymMp2/XcWWOwoz0iLnnWGVI+jOyxD2Ee2XC1+qd wag99dadD86+3Ivnp/WS+crh2gufn/x7N95uNrwOPtYuynzS64WzKUOUBAzkbt8psxRg Q9f81bvqgYpv+/o9qAOwxCfO/xMyklPdjAKdiY9Y14zUOZQI7zlqA/KtJoMrHjl7sYiC AKKEwoLC9mPwwMdENzyQ7x5I3QZ5GbJ50s/Usv7gwa7PFCAfc3n9N2gfjQKEVDOd+qzZ GHbA== X-Gm-Message-State: ALoCoQkQxidaJuElCTQIxi5jPpgD7vjuh1CC2O6/3PfxqeaiMybdTIOJQ/wNDv79SmI/zw1Wogk/ X-Received: by 10.58.187.6 with SMTP id fo6mr3706728vec.34.1393671398070; Sat, 01 Mar 2014 02:56:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.119 with SMTP id d110ls1423868qga.32.gmail; Sat, 01 Mar 2014 02:56:38 -0800 (PST) X-Received: by 10.220.67.18 with SMTP id p18mr7002231vci.14.1393671397975; Sat, 01 Mar 2014 02:56:37 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id x7si1326442vel.114.2014.03.01.02.56.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 02:56:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so1825935vcb.31 for ; Sat, 01 Mar 2014 02:56:37 -0800 (PST) X-Received: by 10.58.170.69 with SMTP id ak5mr7037638vec.28.1393671397887; Sat, 01 Mar 2014 02:56:37 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.130.193 with SMTP id u1csp114214vcs; Sat, 1 Mar 2014 02:56:37 -0800 (PST) X-Received: by 10.152.27.193 with SMTP id v1mr15335997lag.4.1393671396667; Sat, 01 Mar 2014 02:56:36 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id k3si14681452lam.101.2014.03.01.02.56.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 02:56:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.217.182 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id n15so3448579lbi.13 for ; Sat, 01 Mar 2014 02:56:36 -0800 (PST) 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 Cc: linux-arm-kernel@lists.infradead.org, Kevin Hilman , Alan Stern , Greg Kroah-Hartman , Mark Brown , Russell King , Linus Walleij , Wolfram Sang , Alessandro Rubini , Josh Cartwright , Ulf Hansson 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) };