Bug 230967

Summary: mmc driver trashes 4GB SD card
Product: [Fedora] Fedora Reporter: Paul Dickson <paul>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CANTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-26 05:46:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/var/log/messages while inserting the SD via a USB2.0 reader none

Description Paul Dickson 2007-03-05 04:32:42 UTC
Description of problem:
Writing 1.25GB of files to a 4GB SD card trashes the file system on the card.

Version-Release number of selected component (if applicable):
kernel-2.6.20-1.2962.fc7

How reproducible:
Always

Steps to Reproduce:
1.Created a cpio file of files approximately the size of compressed audio files.
2.Unpack that file on a mounted 4GB SD card
3.After near 512MB (approximately) the system will become sluggish (logging
activity likely sucking all of the CPU)
4. The cpio unpacking stops with Input/Output Error
  
Actual results:
A SD card that fsck.vfat may (or may not) be able to fix.

Expected results:
All files saved on the card

Additional info:
In the log file:

Mar  4 20:45:36 white kernel: BUG: warning at
drivers/mmc/sdhci.c:160/sdhci_reset() (Not tainted)
Mar  4 20:45:36 white kernel:  [<c04061ed>] show_trace_log_lvl+0x1a/0x2f
Mar  4 20:45:36 white kernel:  [<c04067b1>] show_trace+0x12/0x14
Mar  4 20:45:36 white kernel:  [<c0406835>] dump_stack+0x16/0x18
Mar  4 20:45:36 white kernel:  [<f8a4c3d8>] sdhci_reset+0xc5/0xe7 [sdhci]
Mar  4 20:45:36 white kernel:  [<f8a4c9e2>] sdhci_finish_data+0xcb/0x110 [sdhci]
Mar  4 20:45:36 white kernel:  [<f8a4cf52>] sdhci_irq+0x444/0x4b1 [sdhci]
Mar  4 20:45:36 white kernel:  [<c0458782>] handle_IRQ_event+0x1a/0x46
Mar  4 20:45:36 white kernel:  [<c045986f>] handle_fasteoi_irq+0x7d/0xb6
Mar  4 20:45:36 white kernel:  [<c0407544>] do_IRQ+0xb1/0xd9
Mar  4 20:45:36 white kernel:  =======================
Mar  4 20:45:36 white kernel: mmcblk0: error 1 transferring data
Mar  4 20:45:36 white kernel: end_request: I/O error, dev mmcblk0, sector 2383840
Mar  4 20:45:37 white kernel: mmcblk0: error 1 transferring data
Mar  4 20:45:37 white kernel: end_request: I/O error, dev mmcblk0, sector 2383848

The last four lines repeat over and over (with different values.  This activity
bogs down the system.

I'm using my notebook's (Dell Inspiron 6000) SD card reader:
03:01.2 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 17)

Comment 1 Paul Dickson 2007-03-05 05:09:52 UTC
Created attachment 149246 [details]
/var/log/messages while inserting the SD via a USB2.0 reader

This is very likely unrelated:	I'm attempting to insert the SD card using a
USB 2.0 SD card reader.  The attached file is the logged output during the
device insert (and removal: after the line with "REMOVED").

I do get a /dev/sdb device, but fdisk will not read it.  I'm definitely NOT
getting the /dev/sdb1 partition which I can still get on the SD card slot on
the notebook after a eject and insert cycle.

I want to use this SD card reader so I can reformat the SD card.

For what it's worth.  I have not yet rebooted since the BUG that started this
bug report.

Comment 2 Paul Dickson 2007-03-12 04:26:38 UTC
This bug might have to do with using larger than 2GB SD card than with any
general bug.  I was able to upload the data without problems to a 2GB SD card
using 2.6.20-1.2981.fc7.  I have not retested the 4 GB card with this kernel.

Comment 3 Dave Jones 2007-03-26 05:46:10 UTC
I think this is actually a hardware defect with a lot of cheaper card readers.
I managed to duplicate this with a 4GB card, using a reader that exhibited
similar problems that you describe.  Why I think this is a hardware problem is
that it corrupted the card on Windows too.

There are two types of >2GB cards out there.
- SDHC cards (which need an SDHC capable reader)
- old format SD cards that break the spec and just happen to work on some
readers, but not all.

I don't think there's much we can do here.