# USB3 external drive fails on copy [FIGURED OUT]

## albright

I have just built a new computer: asus p8p67 rev 3.1,

core i7-2600, vertex 3 ssd (so 6gb/s sata), with an

old nvidia 9600gt based graphics card. 

I wanted to try out usb 3.0 so I got an enclosure

(mukii tip330u3-bk).

There is no problem recognized or mounting the drive.

But if I copy a large amount of data it will invariably 

fail after a short time.

Here's the error  messages 

```
Nov 12 13:22:21 olorin kernel: usb 6-2: USB disconnect, device number 7

Nov 12 13:22:22 olorin kernel: xhci_hcd 0000:06:00.0: WARN: transfer error on endpoint

Nov 12 13:22:22 olorin kernel: sd 7:0:0:0: [sdd] Unhandled error code

Nov 12 13:22:22 olorin kernel: sd 7:0:0:0: [sdd]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

Nov 12 13:22:22 olorin kernel: sd 7:0:0:0: [sdd] CDB: Read(10): 28 00 0f 05 b2 2f 00 00 f0 00

Nov 12 13:22:22 olorin kernel: end_request: I/O error, dev sdd, sector 252031535

Nov 12 13:22:22 olorin kernel: sd 7:0:0:0: [sdd] Unhandled error code

Nov 12 13:22:22 olorin kernel: sd 7:0:0:0: [sdd]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

Nov 12 13:22:22 olorin kernel: sd 7:0:0:0: [sdd] CDB: Read(10): 28 00 0f 05 b3 1f 00 00 f0 00

Nov 12 13:22:22 olorin kernel: end_request: I/O error, dev sdd, sector 252031775

```

then a bunch of ext3 error messages (e.g. journal commit I/O error) and then finally

```
Nov 12 13:22:22 olorin kernel: EXT3-fs (sdd1): error: remounting filesystem read-only

Nov 12 13:22:23 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:23 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:23 olorin kernel: usb 6-2: device not accepting address 8, error -71

Nov 12 13:22:23 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:23 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:24 olorin kernel: usb 6-2: device not accepting address 9, error -71

Nov 12 13:22:24 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:24 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:24 olorin kernel: usb 6-2: device not accepting address 10, error -71

Nov 12 13:22:24 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:24 olorin kernel: usb 6-2: Device not responding to set address.

Nov 12 13:22:25 olorin kernel: usb 6-2: device not accepting address 11, error -71

Nov 12 13:22:25 olorin kernel: hub 6-0:1.0: unable to enumerate USB device on port 2
```

Here's the kernel: 3.1.0-gentoo-r1 #2 SMP PREEMPT Sat Nov 12 09:45:13 EST 2011 x86_64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz GenuineIntel GNU/Linux

I'm hoping that someone might have advice about a fix,

but I'm fearing that this is just the current state of usb 3

in linux ...   :Sad: 

Edit: also, the drive works perfectly if plugged into a usb 2 socket

----------

## albright

sorry to self-reply but just a note:

vanilla 3.1.1 does not fix the problem ...

----------

## binnacle

Having same problem here with a 'dd' sequential write test.  Think you're

paying attention to the wrong attributes of the system.

Which USB 3 controller is it?  What's the drive?

Have the problem on a very different system.  What's important is that

the drive is a WDC My Book Essentials 3TB WDBACW0030HBK-00

which shows up in 'dmesg' as

scsi 4:0:0:0: Direct-Access     WD       My Book 1130     1016 PQ: 0 ANSI: 6

scsi 4:0:0:1: Enclosure         WD       SES Device       1016 PQ: 0 ANSI: 6

(1016 is the latest firmware version from WD)

And the USB controller is a ASMedia ASM1042 which shows up in 'lspci -n' as

06:00.0 USB Controller: Device 1b21:1042

Kernel in this case is CentOS 6 2.6.32-71.29.1.el6.x86_64.

I'd be interesting in knowing if you have the same drive and/or USB controller.

Also had a write-test failure with same drive and a cheap SYBA card sporting

a VIA VL800 controller before acquiring this one, which is on a RocketU 1144A.

----------

## binnacle

this WDC drive also works fine when plugged into a USB2 port on a different system

Still seems to me it could be anything: the USB3-to-SATA adapter in the

drive enclosure, the USB3 controller or the Linux device drivers.

----------

## albright

I'm glad I'm not along (but sorry for your troubles)

My drive show us thus:

```
scsi 6:0:0:0: Direct-Access     WDC WD50 00AAKS-00TMA0    0000 PQ: 0 ANSI: 2 CCS

```

then this appears (immediately):

```
sd 6:0:0:0: Attached scsi generic sg4 type 0

scsi: killing requests for dead queue

scsi: killing requests for dead queue

scsi: killing requests for dead queue

scsi: killing requests for dead queue

scsi: killing requests for dead queue

scsi: killing requests for dead queue

scsi: killing requests for dead queue

scsi: killing requests for dead queue

```

(the last irrelevant ???)

Edit: the USB controller from lspci:

```
00:1a.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 05)
```

This is an asus p8p67 rev 3.1 motherboard (bios 2001)

----------

## binnacle

Is there a device line for the enclosure?  E.G.

scsi 4:0:0:1: Enclosure WD SES Device 1016 PQ: 0 ANSI: 6 

I smell a possible Western Digital firmware bug.  Have

already opened a trouble ticket with them (and the

Highpoint for the USB3 controller) in the hope they

know something.

Several online reviews of the RocketU 1144A USB3 card

are out there and none of the reviewers reported any

nasty failures like this.  Makes me suspect the WDC

external drive.  Yours may be a French OEM version of

one of the MyBook devices.

----------

## binnacle

Interesting to see you have an Intel USB3 controller.  Intel created the XHCI

interface specification (where ASMedia is more a consumer of XHCI), so the

probability that it's the controller would be virtually zero in my opinion.

The author of 'xhci_hcd' is Sarah Sharp, who works for Intel.

So that's a super-helpful detail.  Also you're running bleeding-edge

kernels where I'm on the RHEL6 adaptation of 2.6.32.  Makes a driver

problem seem a low probability.

My money's on a WD enclosure firmware bug.  They were the first

out with USB3 external drives and may suffer from bleeding-

edge bugs.  Wish I has one of the new Seagate 4TB USB3 drives

to test (or any other USB3 drive), but I'm not going to spend the

money till I know it will work.

----------

## albright

I had a couple of other WD drives laying around and

tried them out.

First: 

```
scsi 7:0:0:0: Direct-Access     WDC WD16 00JS-22MHB0      0000 PQ: 0 ANSI: 2 CCS
```

exactly the same problem: starts copying and after awhile generates the errors

I listed in the O.P.

then an old WD raptor:

```
scsi 8:0:0:0: Direct-Access     WDC WD74 0GD-00FLC0       0000 PQ: 0 ANSI: 2 CCS
```

exactly the same problem

Of course, these are all WD drives ...

There is nothing in dmesg about the enclosure (which is a cheap one I admit)

----------

## binnacle

I'm inclined to think it's the USB-to-SATA interface in the enclosure

rather than the SATA drives.  SATA is very mature.

I was/am guessing that your enclosure may have a Western Digital

device or perhaps a third-party controller that both WD and

Mukii are using.

But I suppose it could be drivers too.  'xhci_hcd' must be loaded

manually or from a boot script so obviouly it's not considered

mature.

If I hear anything useful from WD or from Highpoint I'll report

back here with it.  I might hit the kernel USB driver mailing lists

for help if the vendors can't figure it out.

----------

## binnacle

FYI I just opened a thread with the USB kernel developers on this.

http://article.gmane.org/gmane.linux.usb.general/54588

Western Digital agreed to escalate the issue to L2 support.

Highpoint has yet to respond.

----------

## albright

One update. Out of curiousity, I tried a different enclosure.

This is a Staples brand (Retail Plus ef80).

It shows up under lsusb as

```
Bus 006 Device 004: ID 174c:55aa ASMedia Technology Inc.
```

This enclosure appears to work. I've transferred back and forth

about a 100 gb without a problem, although I did get this error

report in the log

```
xhci_hcd 0000:06:00.0: ERROR Transfer event TRB DMA ptr not part of current TD
```

and quite a few warnings, such as

```
xhci_hcd 0000:06:00.0: WARN: short transfer on control ep
```

and 

```
xhci_hcd 0000:06:00.0: WARN: Stalled endpoint
```

In my case, it looks like it was perhaps merely a bad enclosure ...

----------

## binnacle

Problem solved.

Purchased a $30 Rosewill USB3 drive dock and it works perfectly.

Identifies itself in 'lsusb' as a ASMedia AS2105.  Works with a 3TB

Seagate drive with 4K sectors and with a 500GB Seagate with 512

byte sectors.

Western Digital USB3-to-SATA microcontrollers have a firmware

or hardware bug that causes them to go suddenly brain-dead.

----------

## binnacle

Funny.  We both fixed it the same way about ten minutes apart.    :Smile: 

----------

## binnacle

I see those warnings as well.  From what I've seen it other posts it's normal.

----------

## binnacle

Final thought/question:

What does 'lsusb -v' show for the Mukii enclosure?  The WD MyBook just says "Western Digital" "WD MyBook 1130" so they are either hiding the true make of the microcontroller or WD does actually make it. Mukii is less likely to have replaced the device strings when they slapped together their product.  Would be useful to have a better idea on who makes the chipset that has the problem.

----------

## albright

glad your's came around

the mukii identifies itself thus:

```
Bus 006 Device 006: ID 152d:0539 JMicron Technology Corp. / JMicron USA Technology Corp.
```

(don't I recall that jmicron ssd controllers were causing a lot of trouble

a while ago ??)

----------

## binnacle

Could be the JMicron USB3/SATA bridge only glitches with WD drives.

Noticed that all yours seem to be WD.  No doubt the drive in the MyBook

is WD.

----------

## albright

 *Quote:*   

> Could be the JMicron USB3/SATA bridge only glitches with WD drives. 

 

it could be - I only had WD drives (which I favour) to test ...

By the way, now that usb 3.0 is working my hdparm -tT results

for the 500gb drive are about 83 MB/sec, which is not too bad.

----------

## binnacle

iostat clocks the 3TB Seagate Barracuda XT ST33000651AS)

here writing at 110 million-bytes-per-second  :Smile:   Forgot

to check read speed but it should be around 125.

Reason I've been so interested in USB3 is that

performance is only slightly below direct attach SATA.

Going to create a 3-way mirror with a Bacula backup of

all the systems here and rotate the third drive

offsite.  Very convenient to do with external

USB drives that run as though they are internal.

----------

## binnacle

Couldn't resist tracking it down.  The exact device with the problem

is a JMicron JMS539 "SuperSpeed USB to SATA II 3.0G Bridge".

http://www.jmicron.com/Product_JMS539.htm

http://www.jmicron.com/PDF/JMS539/JMS539.PDF

Has an 8051 8-bit CPU embedded in it (vintage

Intel x86 instruction set).  I sent JMicron a note

advising them of the issue.  If they pay attention

it should speed up the arrival of a fix by a few

weeks or even months.

----------

## binnacle

At the behest of the USB3 kernel developers I tried the WDC MyBook

with the latest mainline kernel 3.2.0-rc2.  It appears to work fine.

Also tested it with 3.1.1 (issues other than the write-fail forced me to

abandon the RHEL 6.0 kernel) and this works as well.

So the WDC MyBook problem appears to be different than the

Mukii enclosure problem (different USB3/SATA bridges) in the end

even though they look the same in 'dmesg'.

Posting this in case you are interested in trying out the

recent USB3 patches.  Here is the post that inspired

the 3.2.0-rc2 test

http://thread.gmane.org/gmane.linux.usb.general/54588

and here is the reply

http://thread.gmane.org/gmane.linux.usb.general/54588

----------

