LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   usb-storage: Status code -121 error (https://www.linuxquestions.org/questions/linux-hardware-18/usb-storage-status-code-121-error-882429/)

j_kubik 05-24-2011 06:47 AM

[SOLVED] usb-storage: Status code -121 error
 
I am having a strange external-usb-hdd problem. Every time I want to copy data over several mb, transfer stops every couple of megabytes or so for 20-30 secss and then goes on. This makes transfers veeery slow on larger files.

Every time somthing like that happens i get in my dmesg:

Code:

usb-storage: Command READ_10 (10 bytes)
usb-storage:  28 00 23 f4 dc 87 00 00 80 00
usb-storage: Bulk Command S 0x43425355 T 0x3162 L 65536 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 8 entries
usb-storage: Status code -121; transferred 64525/65536
usb-storage: -- short read transfer
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes

Can anyone point me at least to what error code -121 means? In kernel documentation i found only literal codes for them without numerical values.

Update:

My lsusb shows:
Code:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 004: ID 13fd:1840 Initio Corporation
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Disc is connected throught listed usb hub - my mainboard didn't give enough power.

My kernel is 2.6.35.4, as a part from Linux from scratch is self-copmiled (I may paste config file if necesary).

business_kid 05-24-2011 11:40 AM

Quote:

bash-4.1$ grep -C5 121 /usr/include/asm-generic/errno.h
#define ESTALE 116 /* Stale NFS file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
#define EREMOTEIO 121 /* Remote I/O error */
#define EDQUOT 122 /* Quota exceeded */

#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#define ECANCELED 125 /* Operation Canceled */
The overcurrent is probably the issue. The port just gets switched off. Copy a file from another box onto that thing. A usb hub won't reduce the current unless it's independently powered.
/calls on his days as a kernel developer's guinea pig
You can use the following in /etc/modprobe.d/usb.conf or the like
Quote:

option ehci_hcd ignore_oc=1
But careful you don't blow the port!

j_kubik 05-25-2011 05:27 AM

Quote:

Originally Posted by business_kid (Post 4365767)
A usb hub won't reduce the current unless it's independently powered.

It is independently powered. If i connect drive directly to my computer it won't even start (i mean drive doesn't even starts to rotate).
Do you think that although i am using externaly powered hub to connect it, it still might be a current issue?

I also thought that it might be a power issue, but every time this happens, it shows exatly "transferred 64525/65536" (always the same number was transfered), and as far as i understand it, power problems would result in more random distribution of transfered amount of data.
Perhaps it is problem with cables (one package was not sent because of transfer error?)

EDIT:

I played with max_sectors parameter file.
max_secotrs - error at
128 - 64525/65536
64 - 32768/31757
32 - 15373/16384

The difference is always the same and equals 1011 bytes. I am starting to think that this is usb-transfer problem. I will try to experiment with different cables.

EDIT 2:

I exchanged cables between hub and pc, and between hub and disk and also tried both exchanged - in each case errors were the same. Changing usb port on pc also didn't help.

business_kid 05-26-2011 03:19 AM

I think at this point it's immaterial if the port is switching off or not.

Ports give enough to power usb disks, unless this disk is some strange and unusual concoction we have yet to hear about. Yours requires too much current, indicating a fault condition.

Internally these things have chains of transistors (connected source - drain, i.e. end to end) and if they all turn on, there is 'shoot through' or positive is connected to negative.
If any one transistor is blown, there comes a decision inside the chip which provides this effect, and current skyrockets. You can imagine how this might be fairly repeatable until more transistors blow, which usually doesn't take too long.

j_kubik 05-28-2011 04:21 PM

Wouldn't that cause the same error pattern on the same files? Anyway, i tested it on another computer and it works prfectly there, so it cannot be the reason.

Perhaps i will still try on another computer throught my hub? Perhaps that's source of the problem?

Or perhaps my mainboard has some fault in its usb ports already?

j_kubik 06-24-2011 01:22 PM

I rearanged cables and now it works without problems - perhaps it is faulty cable after all?
Or perhaps the reason was some induction (cable was a bit too long so it was going several times aroud hub in circles), and after rearangning there are no such trouble? No idea, but since it's working i don't want to break it again, so i will not experiment.


All times are GMT -5. The time now is 12:57 AM.