LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   USB Media I/O Errors (https://www.linuxquestions.org/questions/slackware-14/usb-media-i-o-errors-604200/)

bassmadrigal 12-03-2007 02:11 PM

USB Media I/O Errors
 
I have been digging on this since I installed Slack 12, but have been unable to find an answer.

I believe my problem may be related to this thread, but it seemed to go off on another path towards the end, so I will start my own.

Whenever I plug in a USB media device, whether it be my 4GB Thumbdrive, 2GB SD card through my camera (self-powered), 4GB Sony M2 through my phone (self-powered), or my 160GB External HD (self-powered), it will work fine for a while, but eventually I get errors similar to this dumping out through dmesg when I do a file transfer. (This is with my 160GB external)

Code:

scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5
scsi 3:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 5

When this happens it chews up my CPU, although I can leave it running and eventually it will finish the transfer and will allow me to unmount the drive properly. This seems to be completely random, because a couple of days ago when I first hooked up the hard drive, I copied 16GB over in various file sizes (295 files with the largest being a couple of 700MB files). This went without issue, and I started using the drive with bittorrent. Well I wasn't getting all that great of speeds, so I decided to test whether it was my external or not and moved one of the 700MB torrents I was working on over to my local hard drive. It was during the transfer that I got the above messages. With my camera and phone it happens almost every time I copy files over it. With my thumbdrive it is sporadic, but does occur frequently.

I tried building newer kernels with the latest being 2.6.23.1. I will probably be trying the latest kernel this weekend.

One thing that seems to differ from the post I mentioned above is that this is a fairly recent notebook (Dell Inspirion 700m, Centrino 1.7, 1GB RAM), also I have never had this issue since I first moved the notebook to slack with version 10.2, so I don't think it is a power related problem with the USB ports. It has only happened since I installed Slack 12.

I would really like to get some insight into what causes this, and possible fixes, as waiting 4hours to copy 1GB of music to my phone is ridiculous. I am willing to provide any needed info.

Oh here is the usb portion of lspci -vv

Code:

00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03) (prog-if 00 [UHCI])
        Subsystem: Dell Unknown device 018d
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin A routed to IRQ 11
        Region 4: I/O ports at 1820 [size=32]

00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03) (prog-if 00 [UHCI])
        Subsystem: Dell Unknown device 018d
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin B routed to IRQ 10
        Region 4: I/O ports at 1840 [size=32]

00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03) (prog-if 00 [UHCI])
        Subsystem: Dell Unknown device 018d
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin C routed to IRQ 10
        Region 4: I/O ports at 1860 [size=32]

00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03) (prog-if 20 [EHCI])
        Subsystem: Dell Unknown device 018d
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin D routed to IRQ 11
        Region 0: Memory at e0100000 (32-bit, non-prefetchable) [size=1K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [58] Debug port

Thanks
Jeremy

rootboy 12-04-2007 10:04 PM

From what I've found, it sounds like a kernel problem.

"There seems to be some big problem with USB in the 2.6.23 kernel. I had a similar issue with an external hard drive as well and in the end have downgraded back to 2.6.22 until this is fixed up. Now, everything works again."

Start reading from the post by "Mazaev".

http://bbs.archlinux.org/viewtopic.php?pid=304043

bassmadrigal 12-05-2007 11:20 AM

The default kernel with Slack 12, was 2.6.21.5. I then upgraded to 2.6.22.8, and am now currently running 2.6.23.1. All of the kernels had the same issue, so I am not so sure it is the kernel itself, unless I am missing an important option.

onebuck 12-05-2007 04:20 PM

Hi,

Quote:

Originally Posted by bassmadrigal (Post 2981114)
The default kernel with Slack 12, was 2.6.21.5. I then upgraded to 2.6.22.8, and am now currently running 2.6.23.1. All of the kernels had the same issue, so I am not so sure it is the kernel itself, unless I am missing an important option.

Did you read the post; http://bbs.archlinux.org/viewtopic.php?pid=304043 that was provided. Rather obvious to me what you should do. Roll back the kernel plus check your udev rules.

What I read was that each level had problems with that kernel and slight differences since the usb devices were not the same.

bassmadrigal 12-06-2007 04:52 AM

Quote:

Originally Posted by onebuck (Post 2981393)
Hi,

Did you read the post; http://bbs.archlinux.org/viewtopic.php?pid=304043 that was provided. Rather obvious to me what you should do. Roll back the kernel plus check your udev rules.

What I read was that each level had problems with that kernel and slight differences since the usb devices were not the same.

Yes I did read the post. From that it seems that the issue is related to the 2.6.23 kernel, which I am currently running. However, the default install of Slackware 12.0 (which is when my problem first arose) is not running the 2.6.23 series, so I don't know how rolling back will help, when my problem existed in kernels prior to the 2.6.23 series.

As far as my udev rules I have not modified them at all and there are very few references to usb devices, but the following is all the lines pertaining to usb.

Code:

jbhansen@therapist:/etc/udev/rules.d$ cat * | grep usb
KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
# usb devices
SUBSYSTEMS=="usb", IMPORT{program}="usb_id -x"
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", ENV{ID_CLASS}="kbd"
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", ENV{ID_CLASS}="mouse"
# usb devices
KERNEL=="hiddev*",              NAME="usb/%k"
KERNEL=="auer*",                NAME="usb/%k"
KERNEL=="legousbtower*",        NAME="usb/%k"
KERNEL=="dabusb*",              NAME="usb/%k"
SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp", MODE="0664"
# libusb device access
DEVPATH=="/module/usbcore", ACTION=="add", \
              RUN+="/bin/sh -c 'sleep 1; /bin/mount none -t usbfs /proc/bus/usb -o devmode=0666,devgid=10'"
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libmtp_rules_end"
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libnjb_rules_end"
# udev rules file for pilot-link's libpisock library, enabled for libusb
SUBSYSTEMS!="usb", ACTION!="add", GOTO="libpisock_rules_end"
SUBSYSTEM!="usb_device", GOTO="libsane_rules_end"

Maybe I am not understanding what you mean by rolling back, but if I go earlier than the 2.6.21.5 kernel, don't you run into problems running a kernel lower than what the system was built with? And I am not very familiar with udev, so I might be missing something simple in that.

Thanks for your time.

onebuck 12-06-2007 07:53 AM

Hi,

I thought you were still attempting to use the 2.6.23 kernels.

shadowsnipes 12-06-2007 10:49 AM

Seeing as this wasn't and issue for you with 10.1, maybe you should try downgrading to Slackware 11 and then upgrade only the packages you need to.

First, I would lsmod to check the modules being loaded before and after you attach a device for the first time after boot.

I don't think anything would be wrong with the default udev rules. More than likely there is some kernel option for your hardware that you need to specify in order for it to work properly. If it is a module that needs to be loaded then perhaps the wrong one is being loaded or the right one isn't being loaded.

Did you just do a make oldconfig when you built the other kernels or did you check everything out? If none of that seems to help perhaps downgrading to Slackware 11, as I mentioned before, would be of some help.

bassmadrigal 12-06-2007 11:12 AM

When I built the new kernels, I copied the config Patrick used into the current src directory and renamed it to .config, I then ran make menuconfig (although from what I read, this sounds like I've been doing it wrong for years even though it has always worked). But when I build my kernels I always go through to make sure things are properly built (prime example was in moving to 2.6.23 because of the change in wireless drivers).

When I build the latest kernel in the next couple of days I will try the make oldconfig with the original config Patrick used.

As far as downgrading to 11.0, I have seriously considered it. Not only because of this, but I have had other minor problems (never could get compiz running), but they don't bug me nearly as much as this one. But I started having issues compiling certain programs, because of the need of newer libs and headers, and I don't want to go through the hassle of backing everything up, then reinstalling. So as bad as it may be, if I can't get this fixed, I will probably just wait until the next Slackware comes out, and hope it runs better on my system.

shadowsnipes 12-06-2007 12:15 PM

Hopefully you will get this figured out because I imagine the next Slackware won't be coming out for around five months (unless Pat does like he did for 10.1, 10.2).

Have your logs said anything about your hardware that stands out (at boot up). I'm just wondering if there are any bus controller errors, etc.

bassmadrigal 12-06-2007 12:40 PM

Well I will have to wait until I reboot to get messages from there, but I don't remember anything out of the ordinary. This is my 160GB hard drive detection output on dmesg when I connect it. Again everything looks fine (at least to me).

Code:

usb 1-5: new high speed USB device using ehci_hcd and address 9
usb 1-5: configuration #1 chosen from 1 choice
scsi6 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 9
usb-storage: waiting for device to settle before scanning
scsi 6:0:0:0: Direct-Access    WDC WD16 00JB-00EVA0      0000 PQ: 0 ANSI: 0
sd 6:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 27 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
sd 6:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 27 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 6:0:0:0: [sda] Attached SCSI disk
sd 6:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete

I figure I probably ought to mention this (even though I highly doubt it is the cause), but this hard drive is formated NTFS (drive from my dead desktop, while I am waiting to build a new one). I am using the ntfs-3g driver with fuse. The drive is mounted with defaults plus a umask of 0000. The reason why I have a hard time believing that it is the ntfs is my phone, thumb drive and camera, are all (I assume) FAT. I have not tried formating them to a linux filesystem to see if that fixes any issues although I might look into it this weekend.

shadowsnipes 12-06-2007 12:45 PM

It's probably not the filesystem but a driver issue instead (especially considering it is multiple devices having the problem). I'm guessing something is wrong with the bus controller driver.

skolnick 12-30-2007 03:44 PM

I have this exact issue:

Code:

usb 1-4: new high speed USB device using ehci_hcd and address 4
usb 1-4: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi4 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 4:0:0:0: Direct-Access    Hitachi  HDT725032VLAT80  A42A PQ: 0 ANSI: 2 CCS
sd 4:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 00 38 00 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
sd 4:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 00 38 00 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 4:0:0:0: [sdb] Attached SCSI disk
sd 4:0:0:0: Attached scsi generic sg2 type 0
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sdb1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
bttv0: PLL can sleep, using XTAL (28636363).
usb 1-4: USB disconnect, address 4
scsi 4:0:0:0: rejecting I/O to dead device
EXT3-fs error (device sdb1): ext3_find_entry: reading directory #2 offset 0
scsi 4:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sdb1, logical block 0
lost page write due to I/O error on sdb1
scsi 4:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sdb1, logical block 0
lost page write due to I/O error on sdb1
gpulido@hades:~$ uname -a
Linux hades 2.6.22-3-k7 #1 SMP Mon Nov 12 09:12:50 UTC 2007 i686 GNU/Linux
gpulido@hades:~$ su -

This is a 300GB Hitachi hard drive inside a thermaltake USB enclosure, connected via USB to my PC. All i did was turning the hard drive on, and mounted it, I did no transfer to/from it. It lasted about 4 hours before it disconnected. I am using debian lenny, this is the uname -a:

Linux hades 2.6.22-3-k7 #1 SMP Mon Nov 12 09:12:50 UTC 2007 i686 GNU/Linux

Thanks for any help.


All times are GMT -5. The time now is 01:23 AM.