Hi !
READ CAPACITY command seems to return fuzzy value when I plug my Sony
Ericsson V630i (rebranded K610i by Vodaphone). Here is an excerpt of
dmesg :
May 27 13:18:57 neo kernel: [236303.330175] SCSI device sdb: 466907 512-byte
hdwr sectors (239 MB)
May 27 13:18:57 neo kernel: [236303.338172] sdb: test WP failed, assume Write
Enabled
May 27 13:18:57 neo kernel: [236303.338177] sdb: assuming drive cache: write
through
May 27 13:18:57 neo kernel: [236303.338183] sdb: sdb1
May 27 13:18:57 neo kernel: [236303.349178] sdb: p1 exceeds device capacity
May 27 13:18:57 neo kernel: [236303.351203] sd 21:0:0:0: Attached scsi
removable disk sdb
May 27 13:18:57 neo kernel: [236303.351248] sd 21:0:0:0: Attached scsi generic
sg2 type 0
May 27 13:18:57 neo kernel: [236303.351793] Device driver target21:0:1 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.352279] Device driver target21:0:2 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.352549] Device driver target21:0:3 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.352643] Device driver target21:0:4 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.352761] Device driver target21:0:5 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.352856] Device driver target21:0:6 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.352963] Device driver target21:0:7 lacks
bus and class support for being resumed.
May 27 13:18:57 neo kernel: [236303.353050] usb-storage: device scan complete
May 27 13:18:57 neo kernel: [236303.445181] attempt to access beyond end of
device
May 27 13:18:57 neo kernel: [236303.445188] sdb: rw=0, want=466942, limit=466907
May 27 13:18:57 neo kernel: [236303.445190] printk: 70 messages suppressed.
May 27 13:18:57 neo kernel: [236303.445193] Buffer I/O error on device sdb1,
logical block 466904
May 27 13:18:57 neo kernel: [236303.445439] attempt to access beyond end of
device
I have tried to add my device to unusual_devs.h with flag
US_FL_FIX_CAPACITY with no luck. This flag decreases by one the capacity
of the drive while mine is too low.
Here is the output of fdisk -l -u
Disk /dev/sdb: 239 MB, 239056384 bytes
16 heads, 32 sectors/track, 911 cylinders, total 466907 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 37 466943 233453+ 6 FAT16
I have noticed that 466907 + 37 = 466944 which should be the correct
value. Therefore, I have added a flag US_FL_REPORT_P1_CAPACITY that just
adds 37 to capacity in sd.c. Well, that does not work either and I don't
know why. dmesg says :
May 27 17:55:20 neo kernel: [ 96.382982] SCSI device sdb: 466944 512-byte
hdwr sectors (239 MB)
May 27 17:55:20 neo kernel: [ 96.389786] sdb: assuming Write Enabled
May 27 17:55:20 neo kernel: [ 96.396513] sdb: assuming drive cache: write
through
May 27 17:55:20 neo kernel: [ 96.403187] sdb: sdb1
May 27 17:55:20 neo kernel: [ 96.421006] sd 10:0:0:0: Attached scsi removable
disk sdb
May 27 17:55:20 neo kernel: [ 96.427885] sd 10:0:0:0: Attached scsi generic
sg2 type 0
May 27 17:55:20 neo kernel: [ 96.434727] Device driver target10:0:1 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.441634] Device driver target10:0:2 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.448359] Device driver target10:0:3 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.454942] Device driver target10:0:4 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.461643] Device driver target10:0:5 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.468207] Device driver target10:0:6 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.474435] Device driver target10:0:7 lacks bus
and class support for being resumed.
May 27 17:55:20 neo kernel: [ 96.480608] usb-storage: device scan complete
May 27 17:55:20 neo kernel: [ 96.505954] end_request: I/O error, dev sdb,
sector 466941
May 27 17:55:20 neo kernel: [ 96.512064] Buffer I/O error on device sdb1,
logical block 466904
May 27 17:55:20 neo kernel: [ 96.524950] end_request: I/O error, dev sdb,
sector 466942
And after that, I think that my phone is not able to cope any request.
May 27 17:55:20 neo kernel: [ 96.852880] end_request: I/O error, dev sdb,
sector 37
May 27 17:55:20 neo kernel: [ 96.862878] end_request: I/O error, dev sdb,
sector 38
Then
May 27 17:56:00 neo kernel: [ 136.547901] Buffer I/O error on device sdb,
logical block 0
May 27 17:56:00 neo kernel: [ 136.549758] Buffer I/O error on device sdb,
logical block 1
May 27 17:56:00 neo kernel: [ 136.551619] Buffer I/O error on device sdb,
logical block 2
To check that the size reported by READ CAPACITY is the first partition
size, I have started with a clean 2.6.21 kernel. I have plugged my phone
and here is the partition I have created :
Disk /dev/sdb: 239 MB, 239056384 bytes
16 heads, 32 sectors/track, 911 cylinders, total 466907 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 32 465919 232944 83 Linux
Now, I unplug and replug the phone. And here is what I get :
May 27 18:19:05 neo kernel: [ 1109.211680] SCSI device sdb: 465888 512-byte
hdwr sectors (239 MB)
May 27 18:19:05 neo kernel: [ 1109.218679] sdb: test WP failed, assume Write
Enabled
May 27 18:19:05 neo kernel: [ 1109.218682] sdb: assuming drive cache: write
through
May 27 18:19:05 neo kernel: [ 1109.227676] SCSI device sdb: 465888 512-byte
hdwr sectors (239 MB)
May 27 18:19:05 neo kernel: [ 1109.234674] sdb: test WP failed, assume Write
Enabled
May 27 18:19:05 neo kernel: [ 1109.234677] sdb: assuming drive cache: write
through
May 27 18:19:05 neo kernel: [ 1109.234680] sdb: sdb1
May 27 18:19:05 neo kernel: [ 1109.244678] sdb: p1 exceeds device capacity
May 27 18:19:05 neo kernel: [ 1109.246709] sd 11:0:0:0: Attached scsi removable
disk sdb
May 27 18:19:05 neo kernel: [ 1109.246756] sd 11:0:0:0: Attached scsi generic
sg2 type 0
May 27 18:19:05 neo kernel: [ 1109.247678] usb-storage: device scan complete
May 27 18:19:05 neo kernel: [ 1109.296681] attempt to access beyond end of
device
May 27 18:19:05 neo kernel: [ 1109.296688] sdb: rw=0, want=465920, limit=465888
May 27 18:19:05 neo kernel: [ 1109.296692] printk: 30 messages suppressed.
May 27 18:19:05 neo kernel: [ 1109.296695] Buffer I/O error on device sdb1,
logical block 58235
Disk /dev/sdb: 238 MB, 238534656 bytes
16 heads, 32 sectors/track, 909 cylinders, total 465888 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 32 465919 232944 83 Linux
So it seems that the phone really returns the 465919 - 32 for READ
CAPACITY. Therefore, I don't understand why my change does not work. Any
idea ? How could I debug this ? Maybe the phone builds an erronous
partition table ?
PS: I am not subscribed, keep me in Cc. Thanks.
--
BEWITCHED, DOES NOT PROMOTE SATANISM
BEWITCHED, DOES NOT PROMOTE SATANISM
BEWITCHED, DOES NOT PROMOTE SATANISM
-+- Bart Simpson on chalkboard in episode 2F17
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel