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: 25065 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E3E91203C6 for ; Thu, 20 Feb 2014 15:31:49 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id i4sf6635520oah.3 for ; Thu, 20 Feb 2014 07:31:49 -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=Tl6T72ti4Oh2xQTr63EW8wmkQU28a8jueTA3qf0QHQ3sGOhyMUg03aH04VROtuLjc/ qr+dEGANJaz3WunHRaF7H6XtIjqY+ETu0SNOXAIu0IPXrV0DXCTF6xPpkK5lBf8Oipis H6hykP9if8xMxxuCeubP70Hvp2MWWV2Z/06h+D4XcT6VxcSJZgyJuiUqw8gP/69l3zzN JDCwob3CgmRaNjk5Loi7IEdtVNkgWrxrD4idkJ3isdkMeXuSlfGGD+Rfk/Xz4udoEQnN wD20c0gI5Xec4BTcfGD+dvLEBMjTTBMe+5/HjudYWn+cneEOM/mdUmnuc997vd7iwHcB 2NyQ== X-Gm-Message-State: ALoCoQlJErZf7QJSuzWpN4P5KrdZPfNumePVVPmWqul7o1txIrCGUZQ5axIPCmKDo/idX9YfzYCN X-Received: by 10.182.34.169 with SMTP id a9mr938056obj.49.1392910309316; Thu, 20 Feb 2014 07:31:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.5 with SMTP id q5ls492180qgd.99.gmail; Thu, 20 Feb 2014 07:31:49 -0800 (PST) X-Received: by 10.52.170.3 with SMTP id ai3mr1102185vdc.35.1392910309179; Thu, 20 Feb 2014 07:31:49 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id nc1si1577746vec.138.2014.02.20.07.31.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 07:31:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jx11so1950744veb.7 for ; Thu, 20 Feb 2014 07:31:49 -0800 (PST) X-Received: by 10.52.61.168 with SMTP id q8mr1145496vdr.40.1392910309094; Thu, 20 Feb 2014 07:31:49 -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.174.196 with SMTP id u4csp67187vcz; Thu, 20 Feb 2014 07:31:48 -0800 (PST) X-Received: by 10.180.87.164 with SMTP id az4mr7689735wib.2.1392910304732; Thu, 20 Feb 2014 07:31:44 -0800 (PST) Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by mx.google.com with ESMTPS id fh3si3792573wib.84.2014.02.20.07.31.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 07:31:44 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.171 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.82.171; Received: by mail-we0-f171.google.com with SMTP id u56so1569216wes.2 for ; Thu, 20 Feb 2014 07:31:44 -0800 (PST) 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 Cc: linux-arm-kernel@lists.infradead.org, Kevin Hilman , Alan Stern , Mark Brown , Russell King , Linus Walleij , Wolfram Sang , Alessandro Rubini , Ulf Hansson 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-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.128.176 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) };