Subject: PATA via USB buggy
To: None <netbsd-help@netbsd.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: netbsd-help
Date: 06/11/2005 15:15:43
In the "PATA disk drive not being configured in 2.0.2" thread I wrote:

> Put the PATA drive in a USB-to-PATA box.  Works okay until it gets a read
> error (I assume), then even the simplest command to the disk takes about
> 25 minutes, and always fails.  Power cycle the USB box and the kernel hangs.
> Great fun having to do reboot every time you get a read error.  My latest normal
> (non-debug) kernel is working much better though.  Best guess is that
> taking out cmdide fixed the USB, but I haven't tested that yet.

Looks like it wasn't the cmdide but rather if the ehci ("hi" (480 Mbps) speed)
is configured or not.  That makes a bit more sense.

Without ehci, the only console message I get is

	sd16: fabricating a geometry

and dd returns right away after an i/o error.

Not really in the mood to try power cycling the USB-PATA box
to see if the entire kernel will hang (console dead, modem
connections dropped, it's dead, Jim hit the reset button
and hope that fsck is having a good day kinda hang) without ehci.

Dd-ing the same sectors from the drive (rsd16f) gets different data
every time.  The read is smaller than the disk's onboard cache,
so it should be getting the data from the cache after the first read.
The number of blocks dd reads before getting i/o error varies.

With ehci I get:

sd16: fabricating a geometry
ehci_idone: need toggle update status=d0000d40 nstatus=b0008d80
ehci_idone: need toggle update status=d0000d40 nstatus=b0008d80
umass0: BBB bulk-in stall clear failed, TIMEOUT
umass0: BBB reset failed, TIMEOUT
umass0: BBB bulk-in clear stall failed, TIMEOUT
umass0: BBB bulk-out clear stall failed, TIMEOUT
ehci_idone: need toggle update status=50000d40 nstatus=30008d80
umass0: BBB bulk-in stall clear failed, TIMEOUT
umass0: BBB reset failed, TIMEOUT
umass0: BBB bulk-in clear stall failed, TIMEOUT
umass0: BBB bulk-out clear stall failed, TIMEOUT
ehci_idone: need toggle update status=00000000 nstatus=50000d80
umass0: BBB bulk-in stall clear failed, TIMEOUT
umass0: BBB reset failed, TIMEOUT
umass0: BBB bulk-in clear stall failed, TIMEOUT
umass0: BBB bulk-out clear stall failed, TIMEOUT
ehci_idone: need toggle update status=50000d40 nstatus=30008d80
umass0: BBB bulk-in stall clear failed, TIMEOUT
umass0: BBB reset failed, TIMEOUT
umass0: BBB bulk-in clear stall failed, TIMEOUT
umass0: BBB bulk-out clear stall failed, TIMEOUT
ehci_idone: need toggle update status=00000000 nstatus=50000d80
umass0: BBB bulk-in stall clear failed, TIMEOUT
umass0: BBB reset failed, TIMEOUT
umass0: BBB bulk-in clear stall failed, TIMEOUT
umass0: BBB bulk-out clear stall failed, TIMEOUT

and commands involving the drive (dd, scsictl) take about 25 minutes
to return once a read error occurs.  Rebooting clears this until the
next read error.

DEC Alpha 164lx running 2.0.2

The PCI board is a combo USB and Firewire, and the box is also both
USB and FW to PATA.

fwohci0 at pci1 dev 8 function 0: NEC uPD72871 IEEE 1394 OHCI Host Controller (rev. 0x01)
fwohci0: interrupting at eb164 irq 0
fwohci0: OHCI 1.0, 00:00:4c:01:00:00:00:00, 400Mb/s, 1024 max_rec, 4 ir_ctx, 4 it_ctx
ohci0 at pci1 dev 9 function 0: NEC USB Host Controller (rev. 0x41)
ohci0: interrupting at eb164 irq 7
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
ohci1 at pci1 dev 9 function 1: NEC USB Host Controller (rev. 0x41)
ohci1: interrupting at eb164 irq 11
ohci1: OHCI version 1.0
usb1 at ohci1: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ehci0 at pci1 dev 9 function 2: NEC USB Host Controller (rev. 0x02)
ehci0: interrupting at eb164 irq 15
ehci0: EHCI version 0.95
ehci0: companion controllers, 3 ports each: ohci0 ohci1
usb2 at ehci0: USB revision 2.0
uhub2 at usb2
uhub2: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub2: 5 ports with 5 removable, self powered
[ ... ]
fw0 at fwohci0: 00:00:4c:01:00:00:00:00:09:02:ff:ff:f0:01:00:00
fwohci0: Config ROM:
    0404dded 31333934 68009002 00004c01 00000000 00042236 0300005e 81000003
    0c0083c0 d1000006 00049b20 00000000 00000000 4e657442 53440000 0005635c
    1200005e 81000004 13000001 81000006 95000009 0003c150 00000000 00000000
    49414e41 0003170d 00000000 00000000 49507634 0004127c 0000ffff f0010001
    0000ffff f0010000
fwohci0: nodeid=0xffc0(0), rootid=0, irmid=0
fw0: Updating nodeid to 0
[ ... ]
umass0 at uhub2 port 1 configuration 1 interface 0
umass0: Prolific Technology Inc. ATAPI-6 Bridge Controller, rev 2.00/0.01, addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, 1 lun per target
[ ... ]
sd16 at scsibus1 target 0 lun 0: <Maxtor 6, Y250P0, YAR4> disk fixed
sd16: fabricating a geometry
sd16: 233 GB, 239372 cyl, 64 head, 32 sec, 512 bytes/sect x 490234753 sectors