Bug 722509 - SD card write errors
SD card write errors
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
15
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
:
: 728616 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-15 10:45 EDT by Pavel Emelyanov
Modified: 2011-11-17 18:29 EST (History)
10 users (show)

See Also:
Fixed In Version: kernel-2.6.41.1-1.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-11-17 18:29:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Pavel Emelyanov 2011-07-15 10:45:39 EDT
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 11:35:36 EDT
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 11:54:36 EDT
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 16:53:00 EDT
(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 00:24:13 EDT
> 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 13:32:01 EDT
(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 16:44:52 EDT
(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 16:06:04 EDT
*** Bug 728616 has been marked as a duplicate of this bug. ***
Comment 8 Josh Boyer 2011-10-04 16:52:43 EDT
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 11:27:18 EDT
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 12:15:49 EDT
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 11:21:31 EDT
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-06 20:22:17 EDT
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 17:54:19 EDT
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 18:07:24 EDT
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 11:13:25 EDT
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 10:13:40 EDT
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 15:59:49 EDT
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 15:52:50 EST
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 16:00:25 EST
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-11 19:08:47 EST
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 18:29:27 EST
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.