aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2010-11-28 00:21:28 -0500
committerChris Ball <cjb@laptop.org>2011-01-08 22:48:04 -0500
commit30201e7f3ac639fe98fcd25d40346b65dde9ecba (patch)
treee2abf06a8dbb1cd83d8eeefcaa65440861218dc9 /drivers/mmc/core
parent8f230f454fe04ba326ffaead3a6b88dcf44eaf4b (diff)
mmc: skip detection of nonremovable cards on rescan
mmc_rescan() checks whether registered cards are still present before skipping them, by calling the bus-specific ->detect() handler. With buses that support runtime PM, the card may be powered off at this point, so they need to be powered on and fully reinitialized before ->detect() executes. This whole process is redundant with nonremovable cards; in those cases, we can safely skip calling ->detect() and implicitly assume its success. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Reviewed-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 722af2dce3bb..9683d4d3fced 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1506,8 +1506,12 @@ void mmc_rescan(struct work_struct *work)
1506 1506
1507 mmc_bus_get(host); 1507 mmc_bus_get(host);
1508 1508
1509 /* if there is a card registered, check whether it is still present */ 1509 /*
1510 if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead) 1510 * if there is a _removable_ card registered, check whether it is
1511 * still present
1512 */
1513 if (host->bus_ops && host->bus_ops->detect && !host->bus_dead
1514 && mmc_card_is_removable(host))
1511 host->bus_ops->detect(host); 1515 host->bus_ops->detect(host);
1512 1516
1513 mmc_bus_put(host); 1517 mmc_bus_put(host);