Bug 722509 - SD card write errors
Summary: SD card write errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 728616 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-15 14:45 UTC by Pavel Emelyanov
Modified: 2011-11-17 23:29 UTC (History)
10 users (show)

Fixed In Version: kernel-2.6.41.1-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-17 23:29:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Pavel Emelyanov 2011-07-15 14:45:39 UTC
Description of problem: On my T420S with built-in card reader the sd card can be read, but nothing can be written to it


Version-Release number of selected component (if applicable): kernel 2.6.38.8-35.fc15.x86_64


How reproducible: 100%


Steps to Reproduce:
1. insert sdcard into cardreader
2. mount one (mount -t vfat /dev/mmcblk0p1 /mnt/sdcard/
3. write smth to it (no errors)
4. call sync to force data flush

  
Actual results: data is silently dropped, many errors in dmesg


Expected results: data is written to card


Additional info:

On card insert dmesg says

[ 5972.410033] mmc0: new SD card at address 0002
[ 5972.411419] mmcblk0: mmc0:0002 00000 974 MiB 
[ 5972.413687]  mmcblk0: p1



Here's what I see in dmesg after sync

[ 6033.341748] mmcblk0: error -84 transferring data, sector 262, nr 1, card status 0x900
[ 6033.425992] end_request: I/O error, dev mmcblk0, sector 262
[ 6033.426005] quiet_error: 25 callbacks suppressed
[ 6033.426012] Buffer I/O error on device mmcblk0p1, logical block 15
[ 6033.426017] lost page write due to I/O error on mmcblk0p1
[ 6033.426260] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x400b00
[ 6033.426386] end_request: I/O error, dev mmcblk0, sector 506
[ 6033.426398] Buffer I/O error on device mmcblk0p1, logical block 259
[ 6033.426405] lost page write due to I/O error on mmcblk0p1
[ 6033.426534] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x400b00
[ 6033.426647] end_request: I/O error, dev mmcblk0, sector 736
[ 6033.426657] Buffer I/O error on device mmcblk0p1, logical block 489
[ 6033.426664] lost page write due to I/O error on mmcblk0p1
[ 6033.426778] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x400b00
[ 6033.426891] end_request: I/O error, dev mmcblk0, sector 123360
[ 6033.427198] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x400b00
[ 6033.427295] end_request: I/O error, dev mmcblk0, sector 736
[ 6033.427302] Buffer I/O error on device mmcblk0p1, logical block 489
[ 6033.427307] lost page write due to I/O error on mmcblk0p1
[ 6142.610923] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x400b00
[ 6142.610934] end_request: I/O error, dev mmcblk0, sector 736



The lspci output (this is T420S notebook) is


00:00.0 Host bridge: Intel Corporation Sandy Bridge DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Device 0126 (rev 09)
00:16.0 Communication controller: Intel Corporation Cougar Point HECI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
00:1a.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Cougar Point High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 1 (rev b4)
00:1c.1 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 2 (rev b4)
00:1c.3 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 4 (rev b4)
00:1c.4 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 5 (rev b4)
00:1d.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Cougar Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Cougar Point 6 port SATA AHCI Controller (rev 04)
00:1f.3 SMBus: Intel Corporation Cougar Point SMBus Controller (rev 04)
03:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
05:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 04)
0d:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)

Comment 1 Fabrice Bellet 2011-08-21 15:35:36 UTC
Same problem here on a Thinkpad X220, with kernel-2.6.40.3-0.fc15.x86_64. It looks very similar to what's described here: 

http://comments.gmane.org/gmane.linux.kernel.mmc/8690

Comment 2 Fabrice Bellet 2011-08-21 15:54:36 UTC
this workaround works for me :
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/773524/comments/13

and the upstream bug report:
https://lkml.org/lkml/2011/7/11/381

Comment 3 Josh Boyer 2011-08-21 20:53:00 UTC
(In reply to comment #2)
> this workaround works for me :
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/773524/comments/13
> 
> and the upstream bug report:
> https://lkml.org/lkml/2011/7/11/381

That thread lead to commit 15bed0f2fa8e1d7db201692532c210a7823d2d21 which is in 3.1-rc2, which has a kernel built for f16 here:

http://koji.fedoraproject.org/koji/buildinfo?buildID=259670

which is also queued for updates-testing.

Could you please test that kernel?

Comment 4 Pavel Emelyanov 2011-08-22 04:24:13 UTC
> Could you please test that kernel?

Doesn't work :( Only the workaround with the bunch of setpci-s helps.

Comment 5 Chuck Ebbert 2011-08-22 17:32:01 UTC
(In reply to comment #4)
> > Could you please test that kernel?
> 
> Doesn't work :( Only the workaround with the bunch of setpci-s helps.

Are you seeing the new message?
"MMC controller base frequency changed to 50Mhz."

Comment 6 Fabrice Bellet 2011-08-22 20:44:52 UTC
(In reply to comment #5)
> Are you seeing the new message?
> "MMC controller base frequency changed to 50Mhz."

I don't see this message, and I confirm comment #4.

Comment 7 Josh Boyer 2011-10-04 20:06:04 UTC
*** Bug 728616 has been marked as a duplicate of this bug. ***

Comment 8 Josh Boyer 2011-10-04 20:52:43 UTC
OK, I can confirm that if I run the commands found here:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/773524/comments/13

then the Ricoh SD card reader in my x220 works fine.  That same set of commands should be performed by the PCI quirk, but it isn't registering for some reason.  I'll look into this.

Comment 9 Josh Boyer 2011-10-05 15:27:18 UTC
Ok, so here is what is happening on the x220.

The PCI quirk that was added to fix this issue does get called, however it first checks to see if the proprietary MMC controller is disabled already (either by BIOS or possibly by some previous boot).  If so, then it just returns immediately, which means that we never get to the e823 part of the quirk to lower the clock frequency.

I moved the e823 check above the MMC disable, and things seem to be working rather well.  I'll create a kernel with that patch shortly.

Comment 10 Josh Boyer 2011-10-05 16:15:49 UTC
For those of you still seeing this, the following scratch build has the change I described in comment #9 in it.  Please test with this kernel once it completes:

http://koji.fedoraproject.org/koji/taskinfo?taskID=3406947

The patch itself has been sent upstream:

http://article.gmane.org/gmane.linux.kernel/1199650

Comment 11 Jon VanAlten 2011-10-06 15:21:31 UTC
Now running kernel from build posted above, on Thinkpad X220 with affected internal SD device.  Works a charm, it seems.  Thanks!

Comment 12 Josh Boyer 2011-10-07 00:22:17 UTC
Thanks for testing!  I've added the patch and this should be in the next F15 kernel build.

Comment 13 Fedora Update System 2011-10-17 21:54:19 UTC
kernel-2.6.40.7-0.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/kernel-2.6.40.7-0.fc15

Comment 14 Fedora Update System 2011-10-18 22:07:24 UTC
Package kernel-2.6.40.7-0.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-2.6.40.7-0.fc15'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14513
then log in and leave karma (feedback).

Comment 15 Fedora Update System 2011-10-24 15:13:25 UTC
kernel-2.6.40.7-3.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/kernel-2.6.40.7-3.fc15

Comment 16 Fedora Update System 2011-10-27 14:13:40 UTC
kernel-2.6.40.8-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/kernel-2.6.40.8-2.fc15

Comment 17 Fedora Update System 2011-11-01 19:59:49 UTC
kernel-2.6.40.8-4.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/kernel-2.6.40.8-4.fc15

Comment 18 ValdikSS 2011-11-07 20:52:50 UTC
Hello.
I have Lenovo Thinkpad X220 and I have some issues with the cardreader. My cardreader is Ricoh Co Ltd MMC/SD Host Controller (rev 07), not rev 04 as others have on this laptop.
This issue can be fixed for me using debug_quirks=0x40 or a bunch of setpci's mentioned in comment #8.
In the first message Pavel can mount the card but if I put a card to the cardreader I got:
mmc0: error -110 whilst initialising SD card
or
mmc0: error -84 whilst initialising SD card
I hope we'll see the fix soon.
Sorry for my bad English.

Comment 19 ValdikSS 2011-11-07 21:00:25 UTC
Oh, sorry, just found that my cardreader is e822 with ID [1180:e822], not e823. Should I make another bug and not to write here?

Comment 20 Fedora Update System 2011-11-12 00:08:47 UTC
kernel-2.6.41.1-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/kernel-2.6.41.1-1.fc15

Comment 21 Fedora Update System 2011-11-17 23:29:27 UTC
kernel-2.6.41.1-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


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