Bug 5231 - usb mass storage (mp3-player) i/o errors while read or write
Summary: usb mass storage (mp3-player) i/o errors while read or write
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Alan Stern
URL:
Keywords:
Depends on:
Blocks: USB
  Show dependency tree
 
Reported: 2005-09-12 10:14 UTC by Florian Mickler
Modified: 2006-02-19 09:46 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.12.5, 2.6.13.1, 2.6.14.1
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg after boot - _BEFORE_ plugging in the device (15.05 KB, text/plain)
2005-10-10 17:12 UTC, Florian Mickler
Details
relevant debug info (i hope) (9.00 KB, application/gzip)
2005-10-10 17:20 UTC, Florian Mickler
Details
with usb-storage verbose debug enabled (7.69 KB, application/gzip)
2005-10-11 07:57 UTC, Florian Mickler
Details
/proc/bus/usb/devices with mp3-player pluged in (2.49 KB, application/octet-stream)
2005-10-11 11:42 UTC, Florian Mickler
Details
/proc/bus/usb/devices with mp3-player pluged in (2.49 KB, text/plain)
2005-10-11 11:42 UTC, Florian Mickler
Details
Add unusual_devs entry for the TrekStor i.Beat mp3 player (532 bytes, patch)
2005-10-11 12:48 UTC, Alan Stern
Details | Diff

Description Florian Mickler 2005-09-12 10:14:41 UTC
- attaching my mp3-player(brand and so on see dmesg output at the bottom) to my
usb-port does result in dmesg-errors
- mounting it goes well
- writing to it goes well until sync or umount gets executed ... then there are
dozens of errors about i/o error.
- there is some affection on the mp3-player's flash, but only garbage or empty files
Most recent kernel where this bug did not occur: 2.4 (i tested it once with an
old kernel that dusted away on my /boot and all was going well (could read from
it and write an whole album to it ..)
Distribution: gentoo
Hardware Environment:
16:41:51 dmk@zel:~$ lspci
0000:00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor
to I/O Controller (rev 02)
0000:00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV
Processor to I/O Controller (rev 02)
0000:00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV
Processor to I/O Controller (rev 02)
0000:00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated
Graphics Device (rev 02)
0000:00:02.1 Display controller: Intel Corporation 82852/855GM Integrated
Graphics Device (rev 02)
0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03)
0000:00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03)
0000:00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03)
0000:00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2
EHCI Controller (rev 03)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 83)
0000:00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface
Bridge (rev 03)
0000:00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller
(rev 03)
0000:00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus
Controller (rev 03)
0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
0000:00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97
Modem Controller (rev 03)
0000:01:0a.0 CardBus bridge: O2 Micro, Inc. OZ6933/711E1 CardBus/SmartCardBus
Controller (rev 20)
0000:01:0a.1 CardBus bridge: O2 Micro, Inc. OZ6933/711E1 CardBus/SmartCardBus
Controller (rev 20)
0000:01:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 10)
0000:01:0d.0 Network controller: Intel Corporation PRO/Wireless LAN 2100 3B Mini
PCI Adapter (rev 04)

Software Environment:

Problem Description:
dmesg-output on attaching the mp3-player to the usb-bus
usb 2-1: new full speed USB device using uhci_hcd and address 2
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
  Vendor: TrekStor  Model: i.Beat Joy 2.0    Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sda: 1007264 512-byte hdwr sectors (516 MB)
sda: Write Protect is off
sda: Mode Sense: 00 c0 00 00
sda: assuming drive cache: write through
ioctl_internal_command: <0 0 0 0> return code = 8000002
   : Current: sense key=0x0
    ASC=0x0 ASCQ=0x0
Info fld=0x0
SCSI device sda: 1007264 512-byte hdwr sectors (516 MB)
sda: Write Protect is off
sda: Mode Sense: 00 c0 00 00
sda: assuming drive cache: write through
 sda: sda1
ioctl_internal_command: <0 0 0 0> return code = 8000002
   : Current: sense key=0x0
    ASC=0x0 ASCQ=0x0
Info fld=0x0
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
usb-storage: device scan complete
ioctl_internal_command: <0 0 0 0> return code = 8000002
   : Current: sense key=0x0
    ASC=0x0 ASCQ=0x0
Info fld=0x0
SCSI error : <0 0 0 0> return code = 0x10070000
end_request: I/O error, dev sda, sector 43
Buffer I/O error on device sda1, logical block 8
ioctl_internal_command: <0 0 0 0> return code = 8000002
   : Current: sense key=0x0
    ASC=0x0 ASCQ=0x0
Info fld=0x0



SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1210
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1211
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1212
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1213
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1214
SCSI error : <0 0 0 0> return code = 0x10000

and 
end_request: I/O error, dev sda, sector 1215
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1216
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1217
SCSI error : <0 0 0 0> return code = 0x10000
end_request: I/O error, dev sda, sector 1218

SCSI error : <1 0 0 0> return code = 0x10070000
end_request: I/O error, dev sdb, sector 390580
printk: 74 messages suppressed.
Buffer I/O error on device sdb1, logical block 390545
SCSI error : <1 0 0 0> return code = 0x10070000
end_request: I/O error, dev sdb, sector 390581
SCSI error : <1 0 0 0> return code = 0x10070000
end_request: I/O error, dev sdb, sector 390582
(thats the same device only attached at another time while /dev/sda was not free)


Steps to reproduce:
plug the player in, mount it and write or read to/from it. (or try...)
Comment 1 Florian Mickler 2005-09-12 10:20:00 UTC
by the way, i just remembered, that on my pals windows-machine the stick was
said to "be on a usb-1.0 port, and that it could pe more performant on a
high-speed port" or how they name it at microsoft, besides that he was sticking
at an usb-2.0 highspeed port (seen it myself with an usb-disk) ... so perhaps
there is some issue with the usb-2.0 and usb-1.0 thing.. 

Comment 2 Greg Kroah-Hartman 2005-09-12 14:15:28 UTC
Can you try 2.6.13 or 2.6.13.1 to see if that solve the problem?
Comment 3 Florian Mickler 2005-09-12 15:34:56 UTC
ok, sorry that i didnt had it verified right on  but the bug is also present in
2.6.13.1 with no change at all
Comment 4 Alan Stern 2005-09-28 13:57:28 UTC
We need to get more information.  Try turning on the USB Mass Storage verbose
debugging option in the kernel configuration (CONFIG_USB_STORAGE_DEBUG).  Then
attach the dmesg log showing all the debugging messages for when you try to do
I/O to the device.
Comment 5 Florian Mickler 2005-10-10 17:12:12 UTC
Created attachment 6271 [details]
dmesg after boot - _BEFORE_ plugging in the device

dont know if it is interesting
Comment 6 Florian Mickler 2005-10-10 17:20:18 UTC
Created attachment 6272 [details]
relevant debug info (i hope)

here is what i did:
 - 0th booted kernel 2.6.13.3 (dmesg_boot)
 - 1st plugged the device in (dmesg_plug)
 - 2nd mounted the device (dmesg_mount)
 - 3rd cp'ed a file from the device to my hd (dmesg_cp, shell_cp)
 - 4th umounted the device (dmesg_umount)
 - 5th unplugged the device (dmesg_unplug)

after each step i dumped the dmesg via dmesg -c > filename
also in the archive is lscpi -v, lsusb -v and the relevant part of the system
log

if you need more info or me doing smth plz just say it, i'll glad to help and i
do appreciate your efforts.
Comment 7 Alan Stern 2005-10-11 07:18:45 UTC
Unfortunately those logs don't help enough.  It looks like you turned on USB
verbose debugging (CONFIG_USB_DEBUG) and not USB Mass Storage verbose debugging
(CONFIG_USB_STORAGE_DEBUG).  The mass-storage debugging is what we need.
Comment 8 Florian Mickler 2005-10-11 07:57:49 UTC
Created attachment 6279 [details]
with usb-storage verbose debug enabled
Comment 9 Alan Stern 2005-10-11 08:39:37 UTC
The log shows that your device has a common bug: It sends invalid Residue
values.  I can create a kernel patch to take care of it, but first I need one
more piece of information.  With the player plugged in, please send a copy of
/proc/bus/usb/devices.
Comment 10 Florian Mickler 2005-10-11 11:42:16 UTC
Created attachment 6281 [details]
/proc/bus/usb/devices with mp3-player pluged in

proc/bus/usb/devices with mp3player plugged in
Comment 11 Florian Mickler 2005-10-11 11:42:52 UTC
Created attachment 6282 [details]
/proc/bus/usb/devices with mp3-player pluged in

proc/bus/usb/devices with mp3player plugged in
Comment 12 Alan Stern 2005-10-11 12:48:49 UTC
Created attachment 6283 [details]
Add unusual_devs entry for the TrekStor i.Beat mp3 player

I think this patch will fix your problem.  If it doesn't, provide another dmesg
log for when you plug in the player.
Comment 13 Florian Mickler 2005-10-11 15:36:46 UTC
the patch fixes the problem. thank you

do you know why it did go with 2.4 kernel?
Comment 14 Alan Stern 2005-10-12 07:32:52 UTC
Okay, I'll submit this change for inclusion in the kernel.

Your player worked under 2.4 because the 2.4 driver doesn't check the Residue
value sent by the device.  This ended up causing a problem because some devices
give no indication that an operation has failed, except that the Residue is
non-zero.  But always checking the Residue leads to the opposite problem, as you
saw -- many devices report garbage values for the Residue.
Comment 15 Florian Mickler 2006-02-19 07:53:22 UTC
it seems that the patch is not yet applied to the kernel... is 4 month normal
for such a small fix???
Comment 16 Alan Stern 2006-02-19 08:37:07 UTC
I don't know what you mean.  The patch is already in 2.6.15.  Well, not exactly
the patch I sent you, but an equivalent one submitted back in September by
Stefan Werner.  See

http://marc.theaimsgroup.com/?l=linux-usb-devel&m=112733253530235&w=2
Comment 17 Florian Mickler 2006-02-19 09:46:20 UTC
Hi!

Ok, I'm sorry!

That's my fault. I greped the source for the wrong keyword :|

thx!

greets,
Florian

Note You need to log in before you can comment on or make changes to this bug.