summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@stericsson.com>2011-12-19 16:24:19 +0100
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-07-31 03:40:03 -0700
commit8c8eda3eb618bd7bed2d1339584ece423300563c (patch)
treebff212a7c301c5998029b59c494d8dcac6c10085
parentee2367b525e8c1c5036d170bcba1798abd0ca9c7 (diff)
mmc: core: Add option to prevent eMMC sleep command
Host may now use MMC_CAP2_NO_SLEEP_CMD to disable the use of eMMC sleep/awake command. This option can be used when your platform has 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. In particular, failures have been seen with u-boot; even if it is fixed there, platforms will be slow to update their bootloader binaries. Change-Id: I403f4b2a231dde087095a660189dc2f4e79edfd5 Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Reviewed-by: Hanumath Prasad <hanumath.prasad@stericsson.com> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Acked-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Chris Ball <cjb@laptop.org> Bug 1007644 Bug 936069 Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com> Change-Id: I8b2834e154e338a97bd6d82f177809d47d318ff0 Reviewed-on: http://git-master/r/118914 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
-rw-r--r--drivers/mmc/core/core.c6
-rw-r--r--include/linux/mmc/host.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 3fe73a7c1e99..f7528db8fd06 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2183,6 +2183,9 @@ int mmc_card_awake(struct mmc_host *host)
{
int err = -ENOSYS;
+ if (host->caps2 & MMC_CAP2_NO_SLEEP_CMD)
+ return 0;
+
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead && host->bus_ops->awake)
@@ -2198,6 +2201,9 @@ int mmc_card_sleep(struct mmc_host *host)
{
int err = -ENOSYS;
+ if (host->caps2 & MMC_CAP2_NO_SLEEP_CMD)
+ return 0;
+
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead && host->bus_ops->awake)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0e56f1ae7602..0441661ad59a 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -232,6 +232,13 @@ struct mmc_host {
#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
#define MMC_CAP_BKOPS (1 << 31) /* Host supports BKOPS */
+ unsigned int caps2; /* More host capabilities */
+#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
+#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_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */
+
mmc_pm_flag_t pm_caps; /* supported pm features */
#ifdef CONFIG_MMC_CLKGATE