replace with better fix
svn path=/dists/trunk/linux-2.6/; revision=13720
This commit is contained in:
parent
8c10969ad7
commit
52a7c27516
|
@ -1,34 +0,0 @@
|
|||
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
|
||||
|
||||
[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;
|
|
@ -0,0 +1,60 @@
|
|||
From: Nicolas Pitre <nico@cam.org>
|
||||
Date: Tue, 26 May 2009 23:09:39 +0000 (-0400)
|
||||
Subject: [MMC] mvsdio: fix config failure with some high speed SDHC cards
|
||||
X-Git-Url: http://git.marvell.com/?p=orion.git;a=commitdiff_plain;h=cbd9524f28b10662bd5d81e734e35737aeabb7a9
|
||||
|
||||
[MMC] mvsdio: fix config failure with some high speed SDHC cards
|
||||
|
||||
Especially with Sandisk SDHC cards, the second SWITCH command was failing
|
||||
with a timeout and the card was not recognized at all. However if the
|
||||
system was busy, or debugging was enabled, or a udelay(100) was inserted
|
||||
before the second SWITCH command in the core code, then the timing was
|
||||
so that the card started to work.
|
||||
|
||||
With some unusual block sizes, the data FIFO status doesn't indicate a
|
||||
"empty" state right away when the data transfer is done. Queuing another
|
||||
data transfer in that condition results in a transfer timeout.
|
||||
|
||||
The empty FIFO bit eventually get set by itself in less than 50 usecs
|
||||
when it is not set right away. So let's just poll for that bit before
|
||||
configuring the controller with a new data transfer.
|
||||
|
||||
Signed-off-by: Nicolas Pitre <nico@marvell.com>
|
||||
---
|
||||
|
||||
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
|
||||
index 9d3cfa9..b56d72f 100644
|
||||
--- a/drivers/mmc/host/mvsdio.c
|
||||
+++ b/drivers/mmc/host/mvsdio.c
|
||||
@@ -64,6 +64,31 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data)
|
||||
unsigned int tmout;
|
||||
int tmout_index;
|
||||
|
||||
+ /*
|
||||
+ * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE
|
||||
+ * register is sometimes not set before a while when some
|
||||
+ * "unusual" data block sizes are used (such as with the SWITCH
|
||||
+ * command), even despite the fact that the XFER_DONE interrupt
|
||||
+ * was raised. And if another data transfer starts before
|
||||
+ * this bit comes to good sense (which eventually happens by
|
||||
+ * itself) then the new transfer simply fails with a timeout.
|
||||
+ */
|
||||
+ if (!(mvsd_read(MVSD_HW_STATE) & (1 << 13))) {
|
||||
+ unsigned long t = jiffies + HZ;
|
||||
+ unsigned int hw_state, count = 0;
|
||||
+ do {
|
||||
+ if (time_after(jiffies, t)) {
|
||||
+ dev_warn(host->dev, "FIFO_EMPTY bit missing\n");
|
||||
+ break;
|
||||
+ }
|
||||
+ hw_state = mvsd_read(MVSD_HW_STATE);
|
||||
+ count++;
|
||||
+ } while (!(hw_state & (1 << 13)));
|
||||
+ dev_dbg(host->dev, "*** wait for FIFO_EMPTY bit "
|
||||
+ "(hw=0x%04x, count=%d, jiffies=%ld)\n",
|
||||
+ hw_state, count, jiffies - (t - HZ));
|
||||
+ }
|
||||
+
|
||||
/* If timeout=0 then maximum timeout index is used. */
|
||||
tmout = DIV_ROUND_UP(data->timeout_ns, host->ns_per_clk);
|
||||
tmout += data->timeout_clks;
|
|
@ -28,10 +28,10 @@
|
|||
+ features/arm/allow-alternative-copy-user.patch
|
||||
+ features/arm/alternative-copy-user.patch
|
||||
+ bugfix/all/mvsdio-platform.patch
|
||||
+ bugfix/all/mmc-sd-udelay-switch.patch
|
||||
+ bugfix/all/mvsdio-ignore-high-speed.patch
|
||||
+ bugfix/all/mvsdio-config-failure.patch
|
||||
+ features/arm/kirkwood-cpu-idle.patch
|
||||
+ bugfix/sparc/arch-zimage-target.patch
|
||||
+ bugfix/all/mvsdio-ignore-high-speed.patch
|
||||
+ features/all/bnx2x-Separated-FW-from-the-source.patch
|
||||
+ features/all/bnx2x-driver-version-1.48.105-1.patch
|
||||
- debian/dfsg/drivers-net-bnx2x-disable.patch
|
||||
|
|
Loading…
Reference in New Issue