All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Marí­a Fernández González" <josemariafg@gmail.com>
To: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] mmc: Some microSD cards are not recognized by PCIxx12 SDA controller
Date: Tue, 10 Mar 2009 02:21:21 +0100	[thread overview]
Message-ID: <49B5C091.3090303@gmail.com> (raw)

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

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@gmail.com>

---

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)

             reply	other threads:[~2009-03-10  1:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10  1:21 José Marí­a Fernández González [this message]
2009-03-24 20:17 ` [PATCH 1/1] mmc: Some microSD cards are not recognized by PCIxx12 SDA controller Pierre Ossman
2009-03-25  8:00   ` José Marí­a Fernández González
2009-03-25 16:17     ` Pierre Ossman
2009-03-26 16:37       ` José Marí­a Fernández González
2009-04-05 18:33         ` Pierre Ossman
2009-04-06 23:30           ` José Marí­a Fernández González
2009-04-10 21:35             ` Pierre Ossman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49B5C091.3090303@gmail.com \
    --to=josemariafg@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=drzeus-list@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.