Problems with USB MMC/SD card reader
Hi.
I have problems with a USB card reader with a 1GB SD card. The reader is detected correctly by linux (from /var/log/messages):
-----------------
Feb 23 08:44:11 kepler kernel: usb 3-1: new full speed USB device
using uhci_hcd and address 2
Feb 23 08:44:11 kepler kernel: usb 3-1: configuration #1 chosen from 1 choice
Feb 23 08:44:11 kepler kernel: Initializing USB Mass Storage driver...
Feb 23 08:44:11 kepler kernel: scsi2 : SCSI emulation for USB Mass
Storage devices
Feb 23 08:44:11 kepler kernel: usbcore: registered new driver usb-storage
Feb 23 08:44:11 kepler kernel: USB Mass Storage support registered.
Feb 23 08:44:16 kepler kernel: Vendor: SanDisk Model: Cruzer
Rev: 2.00
Feb 23 08:44:16 kepler kernel: Type: Direct-Access
ANSI SCSI revision: 00
Feb 23 08:44:16 kepler kernel: SCSI device sdb: 1988608 512-byte hdwr
sectors (1018 MB)
Feb 23 08:44:16 kepler kernel: sdb: Write Protect is off
Feb 23 08:44:16 kepler kernel: sdb: assuming drive cache: write through
Feb 23 08:44:16 kepler kernel: SCSI device sdb: 1988608 512-byte hdwr
sectors (1018 MB)
Feb 23 08:44:16 kepler kernel: sdb: Write Protect is off
Feb 23 08:44:16 kepler kernel: sdb: assuming drive cache: write through
Feb 23 08:44:16 kepler kernel: sdb: sdb1
Feb 23 08:44:16 kepler kernel: sd 2:0:0:0: Attached scsi removable disk sdb
Feb 23 08:44:16 kepler kernel: sd 2:0:0:0: Attached scsi generic sg2 type 0-------------------
but immediately after that the logs get flooded by error messages:
------------------
Feb 23 08:44:18 kepler kernel: sd 2:0:0:0: SCSI error: return code = 0x8000002 Feb 23 08:44:18 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:18 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:18 kepler kernel: Info fld=0x1e51f9 Feb 23 08:44:18 kepler kernel: end_request: I/O error, dev sdb, sector 1987065 Feb 23 08:44:18 kepler kernel: Buffer I/O error on device sdb1, logical block 248352 Feb 23 08:44:19 kepler kernel: sd 2:0:0:0: SCSI error: return code = 0x8000002 Feb 23 08:44:19 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:19 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:19 kepler kernel: Info fld=0x1e51f9 Feb 23 08:44:19 kepler kernel: end_request: I/O error, dev sdb, sector 1987065 Feb 23 08:44:19 kepler kernel: Buffer I/O error on device sdb1, logical block 248352 Feb 23 08:44:20 kepler kernel: sd 2:0:0:0: SCSI error: return code = 0x8000002 Feb 23 08:44:20 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:20 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:20 kepler kernel: Info fld=0x1e5271 Feb 23 08:44:20 kepler kernel: end_request: I/O error, dev sdb, sector 1987185 Feb 23 08:44:20 kepler kernel: Buffer I/O error on device sdb1, logical block 248367 Feb 23 08:44:21 kepler kernel: sd 2:0:0:0: SCSI error: return code = 0x8000002 Feb 23 08:44:21 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:21 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:21 kepler kernel: Info fld=0x1e5271 Feb 23 08:44:21 kepler kernel: end_request: I/O error, dev sdb, sector 1987185 Feb 23 08:44:21 kepler kernel: Buffer I/O error on device sdb1, logical block 248367 Feb 23 08:44:22 kepler kernel: sd 2:0:0:0: SCSI error: return code = 0x8000002 Feb 23 08:44:22 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:22 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:22 kepler kernel: Info fld=0x1e5271 Feb 23 08:44:22 kepler kernel: end_request: I/O error, dev sdb, sector 1987185 Feb 23 08:44:22 kepler kernel: Buffer I/O error on device sdb1,
logical block 248367
-------------------
and so on until I disconnect the device.
I think I can exclude hardware errors as the very same hardware works perfecly on the same machine in Windows XP. The SD card works also nicely with my digital camera. Also, the card reader works perfectly with linux with another 256MB SD card and with a 512MB MMC card.
Kernel is vanilla 2.6.16-rc4; output of /proc/bus/usb/devices and .config are attached.
Please let me know if you need more details.
Regards,
Fabio
Hello,
Quoted 7 lines
logical block 248367
Feb 23 08:44:22 kepler kernel: sd 2:0:0:0: SCSI error: return code = 0x8000002 Feb 23 08:44:22 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:22 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:22 kepler kernel: Info fld=0x1e5271 Feb 23 08:44:22 kepler kernel: end_request: I/O error, dev sdb, sector 1987185 Feb 23 08:44:22 kepler kernel: Buffer I/O error on device sdb1,
Quoted 5 lines
logical block 248367
-------------------
Kernel is vanilla 2.6.16-rc4; output of/proc/bus/usb/devicesand.config are attached.
wild guess: enable the CONFIG_SCSI_MULTI_LUN config option.
Signature · 1 line
ml.
Quoted 3 lines
Feb 23 08:44:16 kepler kernel: SCSI device sdb: 1988608 512-byte hdwr sectors (1018 MB) ... Feb 23 08:44:16 kepler kernel: SCSI device sdb: 1988608 512-byte hdwr sectors (1018 MB)
Is stuttering the log of max Lba normal? I think I remember yes?
Quoted 8 lines
but immediately after that the logs get flooded by error messages:
...Feb 23 08:44:18 kepler kernel: sdb: Current: sense key=0x3 Feb 23 08:44:18 kepler kernel: ASC=0x11 ASCQ=0x0 Feb 23 08:44:18 kepler kernel: Info fld=0x1e51f9 Feb 23 08:44:18 kepler kernel: end_request: I/O error, dev sdb, sector 1987065 Feb 23 08:44:18 kepler kernel: Buffer I/O error on device sdb1, logical block 248352and so on until I disconnect the device.
Ick.
x 3 11 = SK ASC from a Scsi device is a claim that Ecc is saying one or more bits of the data read are wrong, as if your flash media were wearing out. Here above we were told max Lba = 1988608 - 1 = x1E57FF.
"Info fld" is probably kmesg-ese meaning sense bytes 3:4:5:6 echoed when byte 0 mask x80 set, i.e., the Lba in error. In this snippet of log we have:
x 3 11 00 1E51F9
x 3 11 00 1E51F9
x 3 11 00 1E5271
x 3 11 00 1E5271
x 3 11 00 1E5271
This isn't a consistently repeated log - our host & device together haven't livelocked in one spot - instead they have reported the first two of a burst of two or more errors that are being tried 2 or 3 or N times.
Quoted 1 line
... works perfecly on the same machine in Windows XP ...
Might Linux differ from Windows by failing early by design if the last blocks are unreliable?
I see we have reason to believe Windows can read data from this card thru this reader without error. Do we also have reason to believe Windows can read all blocks correctly without error?
Have we looked at the event log in Windows? I mean the one near the Disk Manager and Device Manager, that divides into App, Security, and System. x 3 11 complaints from the device often show up there. To see recent events, you can sort by timestamp or clear before experimenting.
If I were you, I'd next try plugging in without automount and then a dd, both in Linux and in the Windows patched to include dd, to see if those dd agree that all the bits read without error.
I'd expect dd reports failed reads in both Linux and Windows, until I had reason to think otherwise, like an evil root cause for the stuttered log of max Lba.