From patchwork Thu Apr 10 13:01:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 28187 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7E43E212DC for ; Thu, 10 Apr 2014 13:02:17 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id i50sf5736718qgf.5 for ; Thu, 10 Apr 2014 06:02:17 -0700 (PDT) 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=NeZP73Pmx46SRRxCBPxqpPnghzesQk5lHR7IBiWZeto=; b=GhXxQJv0Ss7KFl+J/hWMUw5xLjSGBZjaYh3rznF9GJ6peoXQAQN8u8XM/NBbq4AraR 6eq3E9UYIoRK+xM/MBbusKMY3GMheJvNI5UNUlkWSUhBHn1/+9tuSXgdq5njxuRyMGSQ Hh7yoV65qYdm+gIbghXL2lvYrc8oJEEfsE0gNEZCoYpIothZBNdtWr1WIeHuboXzU6HB IOhijYuu+0uyZ8f9QehZcyi+HB4qHF20m3hJA6IIgoYi3+iqGendwq9DEV2aZYGtuuLF j0VAr0i237WXcrqRGomVSm+yUOpjB/Ada+dQvy8um2YSj+Wf28UZxMzU02SJst00/8xU lTNw== X-Gm-Message-State: ALoCoQkftdWnwnilZozb4Qq19q8j7oQjCabik1CdgW42I0RIlvG2cpLAuERt6a6aDeHLYHCFXDD4 X-Received: by 10.236.203.113 with SMTP id e77mr7249297yho.15.1397134937020; Thu, 10 Apr 2014 06:02:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.232 with SMTP id 95ls1133584qgp.68.gmail; Thu, 10 Apr 2014 06:02:16 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr14358484vcb.2.1397134936900; Thu, 10 Apr 2014 06:02:16 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id fn10si671878vdc.207.2014.04.10.06.02.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 06:02:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so3295117vcb.6 for ; Thu, 10 Apr 2014 06:02:16 -0700 (PDT) X-Received: by 10.52.253.75 with SMTP id zy11mr409829vdc.10.1397134936825; Thu, 10 Apr 2014 06:02:16 -0700 (PDT) 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.221.72 with SMTP id ib8csp57362vcb; Thu, 10 Apr 2014 06:02:16 -0700 (PDT) X-Received: by 10.180.82.7 with SMTP id e7mr15179796wiy.6.1397134901678; Thu, 10 Apr 2014 06:01:41 -0700 (PDT) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by mx.google.com with ESMTPS id ax8si1513561wjc.157.2014.04.10.06.01.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 06:01:41 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.170 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.82.170; Received: by mail-we0-f170.google.com with SMTP id w61so3918149wes.29 for ; Thu, 10 Apr 2014 06:01:41 -0700 (PDT) X-Received: by 10.180.20.176 with SMTP id o16mr42621841wie.7.1397134901028; Thu, 10 Apr 2014 06:01:41 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id lb4sm6500371wjb.14.2014.04.10.06.01.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 06:01:40 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King Cc: Linus Walleij , Kevin Hilman , Daniel Lezcano , Ulf Hansson Subject: [PATCH 3/3] mmc: mmci: Put the device into low power state at system suspend Date: Thu, 10 Apr 2014 15:01:32 +0200 Message-Id: <1397134892-20840-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397134892-20840-1-git-send-email-ulf.hansson@linaro.org> References: <1397134892-20840-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.175 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 eb23c89..a40bf70 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1759,36 +1759,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) { @@ -1856,7 +1826,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) };