summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-11-13 19:50:28 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-13 19:50:28 (GMT)
commit0579e303553655245e8a6616bd8b4428b07d63a2 (patch)
tree27471f7bb31e719a97816f329d1357f8b0a3e488 /drivers
parent0f66c08e9611b9a63f2f2fd5af0d12e486c4a02e (diff)
parent63ef731aa6a81e286de78dcc92241d123424ed39 (diff)
downloadlinux-fsl-qoriq-0579e303553655245e8a6616bd8b4428b07d63a2.tar.xz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: MMC: Do not set unsupported bits in OCR response MMC: Poll card status after rescanning cards
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index ee8863c..766bc54 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -475,7 +475,7 @@ static u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
if (bit) {
bit -= 1;
- ocr = 3 << bit;
+ ocr &= 3 << bit;
host->ios.vdd = bit;
mmc_set_ios(host);
@@ -1178,14 +1178,29 @@ static void mmc_rescan(void *data)
{
struct mmc_host *host = data;
struct list_head *l, *n;
+ unsigned char power_mode;
mmc_claim_host(host);
- if (host->ios.power_mode == MMC_POWER_ON)
+ /*
+ * Check for removed cards and newly inserted ones. We check for
+ * removed cards first so we can intelligently re-select the VDD.
+ */
+ power_mode = host->ios.power_mode;
+ if (power_mode == MMC_POWER_ON)
mmc_check_cards(host);
mmc_setup(host);
+ /*
+ * Some broken cards process CMD1 even in stand-by state. There is
+ * no reply, but an ILLEGAL_COMMAND error is cached and returned
+ * after next command. We poll for card status here to clear any
+ * possibly pending error.
+ */
+ if (power_mode == MMC_POWER_ON)
+ mmc_check_cards(host);
+
if (!list_empty(&host->cards)) {
/*
* (Re-)calculate the fastest clock rate which the