aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@stericsson.com>2011-12-19 10:24:19 -0500
committerChris Ball <cjb@laptop.org>2012-01-11 23:58:48 -0500
commitaa9df4fb2adcc73d36fa41e23059519be770aaa5 (patch)
tree3e076fe70dcdd092a9d44084e09946e2036eefc2
parent7efab4f35740c63502e438886cf1e4aa3f3b800f (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. 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>
-rw-r--r--drivers/mmc/core/core.c6
-rw-r--r--include/linux/mmc/host.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 22050525be84..be7569f3fb56 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)
2246{ 2246{
2247 int err = -ENOSYS; 2247 int err = -ENOSYS;
2248 2248
2249 if (host->caps2 & MMC_CAP2_NO_SLEEP_CMD)
2250 return 0;
2251
2249 mmc_bus_get(host); 2252 mmc_bus_get(host);
2250 2253
2251 if (host->bus_ops && !host->bus_dead && host->bus_ops->awake) 2254 if (host->bus_ops && !host->bus_dead && host->bus_ops->awake)
@@ -2261,6 +2264,9 @@ int mmc_card_sleep(struct mmc_host *host)
2261{ 2264{
2262 int err = -ENOSYS; 2265 int err = -ENOSYS;
2263 2266
2267 if (host->caps2 & MMC_CAP2_NO_SLEEP_CMD)
2268 return 0;
2269
2264 mmc_bus_get(host); 2270 mmc_bus_get(host);
2265 2271
2266 if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep) 2272 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 742f0e102e1e..031d865167a2 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -247,6 +247,7 @@ struct mmc_host {
247#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ 247#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
248#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ 248#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */
249#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ 249#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */
250#define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */
250 251
251 mmc_pm_flag_t pm_caps; /* supported pm features */ 252 mmc_pm_flag_t pm_caps; /* supported pm features */
252 unsigned int power_notify_type; 253 unsigned int power_notify_type;