Bug 38922 (Ricoh-e823-crash)

Summary: Lenovo T420 (Sandy Bridge) Crashes on SD Card gpt partition writing and io errors on insert
Product: Drivers Reporter: Peter Vollmer (vollmerpeter)
Component: MMC/SDAssignee: drivers_mmc-sd
Status: RESOLVED OBSOLETE    
Severity: normal CC: akpm, alan, chris, florian, maciej.rutecki, Martin, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.0-rc6 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 36912    
Attachments: Log gzipped
log 3.1-rc1
kernelpanic after login

Description Peter Vollmer 2011-07-07 17:33:43 UTC
Created attachment 64902 [details]
Log gzipped

Hello Kernel Hackers,

when inserting an sd card in the internal slot I get IO errors, when trying to partition with gparted I got a kernel panic.

lspci reports the sd card reader as
0d:00.0 System peripheral: Ricoh Co Ltd Device e823 (rev 05)

attached you find the log generated.

sincerely Peter
Comment 1 Andrew Morton 2011-07-11 20:16:20 UTC
From which kernel version is this a regression?  Was 2.6.39 OK?
Comment 2 Peter Vollmer 2011-07-11 20:58:36 UTC
It is a regression of the 3.0.0-rc6-mainline Kernel. With the current Kernel 2.6.39 of Arch Linux I've had no Problems.
Comment 3 Chris Ball 2011-07-11 21:21:23 UTC
Thanks for the report.

Does reverting the below commit help?  It added some PCI quirks for your chip, and was merged in 3.0-rc5:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be98ca652faa6468916a9b7608befff215a8ca70

If it doesn't help, I can't think of anything else obvious -- it would be great if you could try a bisect between 2.6.39 final and 3.0-rc6.
Comment 4 Chris Ball 2011-07-11 21:23:16 UTC
Oh, yeah -- you could also just disable CONFIG_MMC_RICOH_MMC, assuming it is currently =y on your system.  Does that help?
Comment 5 Chris Ball 2011-07-11 21:35:44 UTC
Hi Peter,

See also this Ubuntu thread:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/773524
Comment 6 Peter Vollmer 2011-07-15 19:06:22 UTC
Hi Chris,
first of all thanks for your help. 

I'm finish with some of your tips:

The tip of comment #4 doesen't work. I've got the error message that the config wasn't able to load. Also the cardreader doesn't work.

The other thing I've done was the bisection thing. The result is this commit:

a3c7778f8153b9e4eceea6738973280b9e63c618 is the first bad commit
commit a3c7778f8153b9e4eceea6738973280b9e63c618
Author: Andrei Warkentin <andreiw@motorola.com>
Date:   Mon Apr 11 16:13:42 2011 -0500

    mmc: sdhci: R1B command handling + MMC_CAP_ERASE.
    
    ERASE command needs R1B response, so fix R1B-type command
    handling for SDHCI controller. For non-DAT commands using a busy
    response, the cmd->cmd_timeout_ms (in ms) field is used for timeout
    calculations.
    
    Based on patch by Chuanxiao Dong <chuanxiao.dong@intel.com>
    Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
    Signed-off-by: Chris Ball <cjb@laptop.org>

:040000 040000 900ad3058ed393172ff7e68a2240a5404c28bfbb bb4a8b4bd336b0a53b8f90ebc37d16929e5ccfd4 M	drivers

I hope I can help to resolve this problem.

Peter
Comment 7 Florian Mickler 2011-08-09 07:49:51 UTC
First-Bad-Commit: a3c7778f8153b9e4eceea6738973280b9e63c618
Comment 8 Chris Ball 2011-08-09 11:09:11 UTC
Hi Peter,

Please could you retry with 3.1-rc1?  We've added a patch to slow down the MMC clock rate on your chipset, which has fixed IO errors on other machines.
Comment 9 Chris Ball 2011-08-09 19:11:02 UTC
.. and if you want to try applying the patch separately, it is:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15bed0f2fa8e1d7db201692532c210a7823d2d21
Comment 10 Peter Vollmer 2011-08-10 10:21:17 UTC
Created attachment 68302 [details]
log 3.1-rc1
Comment 11 Peter Vollmer 2011-08-10 10:23:52 UTC
Hi Chris,
On Kernel 3.1-rc1 the reader doesn't work at all. See the attached log for details.
Comment 12 Peter Vollmer 2011-08-12 08:16:37 UTC
Created attachment 68662 [details]
kernelpanic after login

Hi Chris,

now I've got another kernelpanic from the cardreader, but today it was directly after login. A card was in the readed and it tried to mount it I think. I was the first time. 

Peter
Comment 13 Peter Vollmer 2011-08-12 08:19:06 UTC
I'm using the kernel 3.0-Arch.
Comment 14 Rafael J. Wysocki 2011-08-28 20:05:18 UTC
On Sunday, August 28, 2011, Chris Ball wrote:
> Hi Rafael,
> 
> On Sun, Aug 28 2011, Rafael J. Wysocki wrote:
> > This message has been generated automatically as a part of a report
> > of regressions introduced between 2.6.39 and 3.0.
> >
> > The following bug entry is on the current list of known regressions
> > introduced between 2.6.39 and 3.0.  Please verify if it still should
> > be listed and let the tracking team know (either way).
> >
> >
> > Bug-Entry   : http://bugzilla.kernel.org/show_bug.cgi?id=38922
> > Subject : Lenovo T420 (Sandy Bridge) Crashes on SD Card gpt partition
> > writing and io errors on insert
> > Submitter   : Peter Vollmer <vollmerpeter@googlemail.com>
> > Date                : 2011-07-07 17:33 (53 days old)
> 
> Yes, still present.
Comment 15 Martin Steigerwald 2012-01-09 19:08:44 UTC
Bug #42568 - ThinkPad T520 I/O errors during accessing SD card with internal reader
https://bugzilla.kernel.org/show_bug.cgi?id=42568

might be related, but I think I had this with 2.6.39 as well. I am not completely sure tough, since I didnĀ“t note kernel version of older saved log excerpts.
Comment 16 Alan 2013-12-23 14:06:02 UTC
If this is still present in modern kernels please update the bug