[PATCH 1/1] mmc: Some microSD cards are not recognized by PCIxx12SDA controller

From: José Marí­a Fernández González
Date: Mon Mar 09 2009 - 21:21:43 EST


From: José M. Fernández <josemariafg@xxxxxxxxx>

My working laptop is a Toshiba Tecra M5 with Core2 Duo T7400 and 2GB of
memory. Since I'm using it I have found that some microSD cards (using
their size adapter) are not recognized when they are inserted in the
Tecra M5 SD slot. Now I own one of those cards (a Transcend 2GB
MM8GR02GUACU-PA), which works well with Windows XP and Toshiba drivers.
Looking for a fix I have done some web research about similar laptop
models, and following the clues I found next HTML page:

http://list.drzeus.cx/pipermail/sdhci-devel/2007-December/002089.html

about a kernel patch related to the SD controller in my laptop, which
involves a change on a mmc_delay call on controller startup. The
lspci -vv description for the SD controller is:

06:0b.3 SD Host controller: Texas Instruments PCIxx12 SDA Standard Compliant SD Host Controller (prog-if 01)
Subsystem: Toshiba America Info Systems Device 0001
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 64 (1750ns min, 1000ns max), Cache Line Size: 32 bytes
Interrupt: pin D routed to IRQ 23
Region 0: Memory at ff9ff700 (32-bit, non-prefetchable) [size=256]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: sdhci-pci
Kernel modules: sdhci-pci

When I applied the proposed change from that patch on mmc_delay
after MMC_POWER_ON, kernel started recognizing the microSD card,
but with errors I have seen with other SD cards:

Feb 21 18:39:25 olympo mmc0: card claims to support voltages below the defined range. These will be ignored.
Feb 21 18:39:25 olympo mmc0: SDIO card claims to support the incompletely defined 'low voltage range'. This will be ignored.
Feb 21 18:39:25 olympo mmc0: error -110 whilst initialising SDIO card

So, I extrapolated the change and, by chance, I found the fix,
which consist on raising the mmc_delay from 2 to 10 both on MMC_POWER_UP
and MMC_POWER_ON. I have been using the kernel with this fix for some
weeks, with no problem.

I don't know whether this patch can break something in the behavior of other
SD controllers, but at least it works for my laptop.

Signed-off-by: José M. Fernández <josemariafg@xxxxxxxxx>

---

diff -Nrpu linux-2.6.28.5/drivers/mmc/core/core.c.orig linux-2.6.28.5/drivers/mmc/core/core.c
--- linux-2.6.28.5/drivers/mmc/core/core.c.orig 2009-03-10 01:30:19.000000000 +0100
+++ linux-2.6.28.5/drivers/mmc/core/core.c 2009-03-10 01:29:44.000000000 +0100
@@ -514,7 +514,7 @@ static void mmc_power_up(struct mmc_host
* This delay should be sufficient to allow the power supply
* to reach the minimum voltage.
*/
- mmc_delay(2);
+ mmc_delay(10);

host->ios.clock = host->f_min;
host->ios.power_mode = MMC_POWER_ON;
@@ -524,7 +524,7 @@ static void mmc_power_up(struct mmc_host
* This delay must be at least 74 clock sizes, or 1 ms, or the
* time required to reach a stable voltage.
*/
- mmc_delay(2);
+ mmc_delay(10);
}

static void mmc_power_off(struct mmc_host *host)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/