aboutsummaryrefslogtreecommitdiffstats
path: root/with-linux-3.4/mvsdio-2.patch
blob: 8d53f2a263a1dfe12a555e4548d8fe07d1c10e87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Nicolas Pitre <nico@cam.org>
Date: Tue, 28 Apr 2009 02:38:12 +0000 (-0400)
Subject: [MMC] give Sandisk/Kingston SDHC cards some slack before the SWITCH command
X-Git-Url: http://git.marvell.com/?p=orion.git;a=commitdiff_plain;h=3ea638523747f6d312f11f643a3175c1a4661eec;hp=c0c3df02efed0e5dea9aa4d8313e06e1f68f2cb4

[MMC] give Sandisk/Kingston SDHC cards some slack before the SWITCH command

Without this delay, those cards simply won't work in high speed mode
as the SWITCH command does not succeeds.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Tested-by: Martin Michlmayr <tbm@cyrius.com>
---

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index cd81c39..ba4c7ab 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -263,6 +263,15 @@ static int mmc_switch_hs(struct mmc_card *card)
 		return -ENOMEM;
 	}
 
+	/*
+	 * Some SDHC cards, notably those with a Sandisk SD controller
+	 * (also found in Kingston products) need a bit of slack
+	 * before successfully handling the SWITCH command.  So far,
+	 * cards identifying themselves as "SD04G" and "SD08G" are
+	 * affected
+	 */
+	udelay(100);
+
 	err = mmc_sd_switch(card, 1, 0, 1, status);
 	if (err)
 		goto out;