From patchwork Thu Dec 15 09:36:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5755 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1AAB123E03 for ; Thu, 15 Dec 2011 09:36:27 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 009D5A18172 for ; Thu, 15 Dec 2011 09:36:26 +0000 (UTC) Received: by eaak10 with SMTP id k10so1872675eaa.11 for ; Thu, 15 Dec 2011 01:36:26 -0800 (PST) Received: by 10.205.127.12 with SMTP id gy12mr538591bkc.108.1323941786731; Thu, 15 Dec 2011 01:36:26 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs35320bkc; Thu, 15 Dec 2011 01:36:26 -0800 (PST) Received: by 10.213.5.1 with SMTP id 1mr274010ebt.70.1323941785010; Thu, 15 Dec 2011 01:36:25 -0800 (PST) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com. [207.126.144.149]) by mx.google.com with SMTP id a59si4375698eeb.22.2011.12.15.01.36.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Dec 2011 01:36:24 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTum/k5iRWeOa7m9I6l5fAjOdpiYshwP2@postini.com; Thu, 15 Dec 2011 09:36:24 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id A185D6F; Thu, 15 Dec 2011 09:36:15 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id D3EAA55; Thu, 15 Dec 2011 09:07:40 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id D6659A8094; Thu, 15 Dec 2011 10:36:13 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 15 Dec 2011 10:36:17 +0100 From: Ulf Hansson To: , Chris Ball Cc: Per Forlin , Ulf Hansson , Johan Rudholm , Lee Jones Subject: [PATCH V2] mmc: core: Add option to prevent eMMC sleep command Date: Thu, 15 Dec 2011 10:36:01 +0100 Message-ID: <1323941761-24947-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 Host may now use MMC_CAP2_NOSLEEP to disable the use of eMMC sleep/awake command. This option can be used when you platform have a buggy kernel crash dump software, which is supposed to store the dump on the eMMC, but is not able to wake up the eMMC from sleep state. Signed-off-by: Ulf Hansson Reviewed-by: Hanumath Prasad Reviewed-by: Srinidhi Kasagar --- Changes in v2: - Added some motivation to why this patch is wanted in the commit message. --- drivers/mmc/core/core.c | 6 ++++++ include/linux/mmc/host.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index a2aa860..5a1ce37 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2246,6 +2246,9 @@ int mmc_card_awake(struct mmc_host *host) { int err = -ENOSYS; + if (host->caps2 & MMC_CAP2_NOSLEEP) + return 0; + mmc_bus_get(host); if (host->bus_ops && !host->bus_dead && host->bus_ops->awake) @@ -2261,6 +2264,9 @@ int mmc_card_sleep(struct mmc_host *host) { int err = -ENOSYS; + if (host->caps2 & MMC_CAP2_NOSLEEP) + return 0; + mmc_bus_get(host); if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9a03d03..d07fb27 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -242,6 +242,7 @@ struct mmc_host { #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ +#define MMC_CAP2_NOSLEEP (1 << 4) /* Don't allow sleep command */ mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type;