Bug 9680 - sdhci doesn't recognize inserted card - Ricoh R5C592
Summary: sdhci doesn't recognize inserted card - Ricoh R5C592
Status: REJECTED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: MMC/SD (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Pierre Ossman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-03 11:54 UTC by Radek Pilar
Modified: 2008-03-01 05:52 UTC (History)
0 users

See Also:
Kernel Version: 2.6.23.9, 2.6.23.12
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg output after modules reloaded (2.26 KB, text/plain)
2008-01-15 10:11 UTC, Radek Pilar
Details
dmesg output with 2.6.24 kernel and MMC_DEBUG=y (5.64 KB, text/plain)
2008-01-25 07:07 UTC, Radek Pilar
Details
dmesg output with 2.6.24.1 kernel, MMC_DEBUG=y and ricoh-mmc loaded (6.20 KB, text/plain)
2008-02-09 07:40 UTC, Radek Pilar
Details
dmesg output with 2.6.24.1 kernel, MMC_DEBUG=y and ricoh-mmc loaded (mmcblk0 created, but can't read from it) (58.35 KB, text/plain)
2008-02-09 08:16 UTC, Radek Pilar
Details

Description Radek Pilar 2008-01-03 11:54:28 UTC
Most recent kernel where this bug did not occur: don't know
Distribution: Debian Lenny
Hardware Environment: Lenovo N200 (x86)
Problem Description: 
When I insert SD card to an integrated card reader, green led lights up for a second (not sure, if this isn't done by hardware), but the card isn't recognized, no /dev/mmc* file is created and also no dmesg output.
After 'modprobe sdhci' appears in dmesg:
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci: SDHCI controller found at 0000:08:06.1 [1180:0822] (rev 19)

relevant output from lspci:

08:06.0 FireWire (IEEE 1394): Ricoh Co Ltd Unknown device 0832
08:06.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
08:06.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)
08:06.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
08:06.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)

And also lsmod:
lsmod |grep sdhci
sdhci                  16780  0
mmc_core               27332  1 sdhci
Comment 1 Pierre Ossman 2008-01-13 02:33:50 UTC
The fact that it lights up a bit is good news. That means it is trying to communicate with the card, but failing somewhere along the line.

What you need to do is to compile your kernel with CONFIG_MMC_DEBUG enabled. Then upload the output of the dmesg command after you've inserted a card.
Comment 2 Radek Pilar 2008-01-15 10:11:46 UTC
Created attachment 14466 [details]
dmesg output after modules reloaded

Kernel 2.6.23.12 with MMC_DEBUG=y after modules mmc_core and sdhci being unloaded and loaded again. When I insert a card, nothing more will appear in dmesg output.
Comment 3 Radek Pilar 2008-01-25 07:07:54 UTC
Created attachment 14575 [details]
dmesg output with 2.6.24 kernel and MMC_DEBUG=y

There is an dmesg output with 2.6.24 kernel... At least, it prints something when card is inserted. There are some comments in this file from me.
Comment 4 Pierre Ossman 2008-02-07 22:50:44 UTC
Damn these crappy Ricoh components. It's their half-assed Windows-workaround that is causing problems again. So it would seem that ricoh-mmc is a requirement for you to have any chance of getting this thing up and running.

Unfortunately it seems that the controller is still misbehaving. Are you getting these problems with all cards? And you go include a complete dmesg for the ricoh-mmc case.
Comment 5 Pierre Ossman 2008-02-07 22:53:32 UTC
Btw, it would also help if you throw off an email at both Lenovo and Ricoh stating that their lack of cooperation is causing real problems for their customers. It seems they need to be dragged kicking and screaming....
Comment 6 Radek Pilar 2008-02-09 07:40:51 UTC
Created attachment 14765 [details]
dmesg output with 2.6.24.1 kernel, MMC_DEBUG=y and ricoh-mmc loaded

Well... unfortunately, I can test only this SD card (but in another computer, it works fine) Complete dmesg output is included (now, I've tried reboting several times, but the mmcblk0 device was never created). 
And yes, I will write to Lenovo (and Ricoh) when I'll test integrated modem, firewire and express card.
Comment 7 Radek Pilar 2008-02-09 08:16:21 UTC
Created attachment 14768 [details]
dmesg output with 2.6.24.1 kernel, MMC_DEBUG=y and ricoh-mmc loaded (mmcblk0 created, but can't read from it)

Suddenly, after I've posted previous attachment, I tried inserting card again, result is in attachment. /dev/mmcblk0 was created, but I can't read from/to it.
In the end of this attachment, there is dmesg output when I try dd if=/dev/mmcblk0. dd will fail after 20 seconds because of input/outptut error with 0 records copied. And for that 20 seconds the led is glowing.
Comment 8 Pierre Ossman 2008-02-09 10:17:11 UTC
The controller is claiming CRC errors. Do you still have Windows on the machine so that you can verify that it is not a hardware error?

The log shows one of the initial transfers succeeding. That transfer is done before switching to wide mode, so perhaps there is some error with just a few of the pins. Try changing this line in sdhci.c:

        mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_SDIO_IRQ;

to:

        mmc->caps = MMC_CAP_MULTIWRITE | MMC_CAP_SDIO_IRQ;
Comment 9 Radek Pilar 2008-02-10 06:40:05 UTC
Well, I've never had Windows on this machine. But, with yours modification, it works perfectly, Many thanks!
Comment 10 Pierre Ossman 2008-02-10 11:16:48 UTC
Unfortunately that hack was just meant as a quick test and not as a long term solution. I don't want to go disabling a big part of the chip until we've determined that this is not just a hw bug in your machine.

I don't suppose this is a work machine so that you might have access to another one for comparison?
Comment 11 Radek Pilar 2008-02-10 12:38:05 UTC
No, unfortunately I haven't acces to any computer with the same chip. So you suggest get Windows and try the reader there?
Comment 12 Pierre Ossman 2008-02-13 10:01:56 UTC
If you could get Windows on it, that would help. I've never seen this problem with any system before, so the most likely problem is a hardware issue.

An alternative approach would be if you can find some other N200 owner to compare with.
Comment 13 Radek Pilar 2008-02-28 13:19:57 UTC
Well... Finally, I've managed to get Windows Vista running on it. If I insert this SD card, it detects, that card has been inserted, but when I try to open it, it keeps telling me, that card is not formated. So, this is maybe really hardware bug. Sorry .
Comment 14 Pierre Ossman 2008-03-01 05:52:33 UTC
That's a bummer. I hope you still have warranty so it can get fixed. If you don't, it should be easy to fix if you have some soldering skills (or know someone who has). My guess is that it's just a matter of bad connection between the slot and the circuit board.

I'll close this bug for now. Reopen it if you still have problems when the hardware has been fixed.

Note You need to log in before you can comment on or make changes to this bug.