+ mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     mmc: some microSD cards are not recognized by PCIxx12 SDA controller
has been added to the -mm tree.  Its filename is
     mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: mmc: some microSD cards are not recognized by PCIxx12 SDA controller
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>
Cc: Pierre Ossman <drzeus@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/mmc/core/core.c      |    4 ++--
 drivers/mmc/core/core.c.orig |    8 +-------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff -puN drivers/mmc/core/core.c~mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller
+++ a/drivers/mmc/core/core.c
@@ -597,7 +597,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;
@@ -607,7 +607,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)
diff -puN drivers/mmc/core/core.c.orig~mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller drivers/mmc/core/core.c.orig
--- a/drivers/mmc/core/core.c.orig~mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller
+++ a/drivers/mmc/core/core.c.orig
@@ -578,13 +578,7 @@ void mmc_set_timing(struct mmc_host *hos
  */
 static void mmc_power_up(struct mmc_host *host)
 {
-	int bit;
-
-	/* If ocr is set, we use it */
-	if (host->ocr)
-		bit = ffs(host->ocr) - 1;
-	else
-		bit = fls(host->ocr_avail) - 1;
+	int bit = fls(host->ocr_avail) - 1;
 
 	host->ios.vdd = bit;
 	if (mmc_host_is_spi(host)) {
_

Patches currently in -mm which might be from josemariafg@xxxxxxxxx are

mmc-some-microsd-cards-are-not-recognized-by-pcixx12-sda-controller.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux