aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Rudholm <johan.rudholm@stericsson.com>2012-08-23 07:40:55 -0400
committerChris Ball <cjb@laptop.org>2012-09-04 13:58:27 -0400
commit3339d1e33185798a45dbdb5ea6c0bec1c27ca5fd (patch)
tree6af12b5b69f6092510345999171582a595aa9841
parent36c179a98a0755b98153e8f4ae08243fbfcd18ff (diff)
mmc: core: Do not rescan non-removable devices
If MMC_CAP_NONREMOVABLE is set, only issue a detect job on init. Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/core/core.c5
-rw-r--r--include/linux/mmc/host.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 835c9f001a10..af2c4d2fd69e 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2053,6 +2053,11 @@ void mmc_rescan(struct work_struct *work)
2053 if (host->rescan_disable) 2053 if (host->rescan_disable)
2054 return; 2054 return;
2055 2055
2056 /* If there is a non-removable card registered, only scan once */
2057 if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered)
2058 return;
2059 host->rescan_entered = 1;
2060
2056 mmc_bus_get(host); 2061 mmc_bus_get(host);
2057 2062
2058 /* 2063 /*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f578a71d82a6..d5d9bd4c5aa8 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -300,6 +300,7 @@ struct mmc_host {
300#endif 300#endif
301 301
302 int rescan_disable; /* disable card detection */ 302 int rescan_disable; /* disable card detection */
303 int rescan_entered; /* used with nonremovable devices */
303 304
304 struct mmc_card *card; /* device attached to this host */ 305 struct mmc_card *card; /* device attached to this host */
305 306