Hi,

I have a USB SD card reader which has never worked properly and finally got me
annoyed enough to try to do something about it.  Using a 2.6.22 kernel
(gentoo), I get the following output in dmesg when I plug it in (with a 128MB
SD card inserted):

sd 8:0:0:0: [sdb] 248320 512-byte hardware sectors (127 MB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 8:0:0:0: [sdb] Assuming drive cache: write through
sd 8:0:0:0: [sdb] 248320 512-byte hardware sectors (127 MB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 8:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
end_request: I/O error, dev sdb, sector 248313

The device info (from /proc/bus/usb/devices):
T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  8 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0ea0 ProdID=2153 Rev= 2.00
S:  Manufacturer=USB
S:  Product=Storage Device
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   2 Ivl=125us


After a bit of googling, I tried patching unusual_devs.h, which got me far
enough to be able to mount /dev/sdb1 and I seem to be able to read/write to
the SD card, but with errors in the dmesg output still.  So I guess I'm on the
right track, but maybe there's something else I'm missing?  Any pointers out
there?



Added in drivers/usb/storage/unusual_devs.h:
UNUSUAL_DEV(  0x0ea0, 0x2153, 0x0200, 0x0200,
                "Ours Technology, Inc.",
                "Storage Device",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_CAPACITY ),

After patch:
fdisk -l /dev/sdb

Disk /dev/sdb: 127 MB, 127139328 bytes
8 heads, 32 sectors/track, 969 cylinders
Units = cylinders of 256 * 512 = 131072 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         970      124111+   6  FAT16



dmesg after patch:
USB Mass Storage support registered.
scsi 10:0:0:0: Direct-Access     USB      Storage Device        PQ: 0 ANSI: 2
sd 10:0:0:0: [sdb] 248319 512-byte hardware sectors (127 MB)
sd 10:0:0:0: [sdb] Write Protect is off
sd 10:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 10:0:0:0: [sdb] Assuming drive cache: write through
sd 10:0:0:0: [sdb] 248319 512-byte hardware sectors (127 MB)
sd 10:0:0:0: [sdb] Write Protect is off
sd 10:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 10:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
 sdb: p1 exceeds device capacity
sd 10:0:0:0: [sdb] Attached SCSI removable disk
sd 10:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete
attempt to access beyond end of device
sdb: rw=0, want=248320, limit=248319
printk: 667 messages suppressed.
Buffer I/O error on device sdb1, logical block 248222
attempt to access beyond end of device
sdb: rw=0, want=248320, limit=248319
   [ previous 3 lines repeated 9 times ]
attempt to access beyond end of device
sdb: rw=0, want=248320, limit=248319
   [ previous 2 lines repeated 7 times ]



Thanks
Bruce

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to