usb/umass, devfs: this sucks



Another attempt to use USB-storage with FreeBSD, another moment of
hair-pulling frustration.

I attach the card-reader with the media card already inserted (detection of
card-insertion has not worked in a long time, if ever).

The "disk" appears:

umass1: Genesys USB Reader, rev 2.00/91.38, addr 3
da6 at umass-sim1 bus 1 target 0 lun 0
da6: <Generic STORAGE DEVICE 9138> Removable Direct Access SCSI-0 device
da6: 40.000MB/s transfers
da6: 1938MB (3970048 512 byte sectors: 255H 63S/T 247C)
(da6:umass-sim1:1:0:0): AutoSense Failed

But the "slices" (/dev/da6s1, etc.) don't appear:

http://www.freebsd.org/cgi/query-pr.cgi?pr=usb/76461

In the past, trying to mount, or otherwise read the da6 would result in the
slices appearing -- an awful wart, when it works. So I try it, but it does
not work:

root@aldan:/home/mi (116) mount -tmsdosfs /dev/da6 /mnt
... hang ...

Pressing Ctrl-T:
load: 0.58 cmd: mount_msdosfs 64452 [GEOM topology] 0.00u 0.00s 0% 804k
...
load: 0.47 cmd: mount_msdosfs 64452 [GEOM topology] 0.00u 0.00s 0% 804k

It still hangs, and now other things hang too. top, for example, hangs on
start-up:

mi@aldan:~ (1084) top
... hang ...
Pressing Ctrl-T:
load: 0.57 cmd: top 64480 [devfs] 0.00u 0.00s 0% 1652k
load: 0.57 cmd: top 64480 [devfs] 0.00u 0.00s 0% 1652k
load: 0.57 cmd: top 64480 [devfs] 0.00u 0.00s 0% 1652k
load: 0.57 cmd: top 64480 [devfs] 0.00u 0.00s 0% 1652k

No new window can be opened either -- presumably due to devfs hanging. I
suspect, that anything attempting to use even the /dev/null is hanging now.

So, not only the USB itself is broken, our wonderful devfs is rather creaky
too -- nothing should be in an uninterruptible state like this for more than
a millisecond.

25 minutes later the mount finally gave up:

umass1: BBB reset failed, TIMEOUT
umass1: BBB bulk-in clear stall failed, TIMEOUT
umass1: BBB bulk-out clear stall failed, TIMEOUT
mount_msdosfs: /dev/da6: Input/output error

Things are back to "normal" again, but the media card is still inaccessible.
I'll try to work with it using mtools -- I had some success in the pass
accessing the FAT-filesystem on the media cards using mcopy, mdir, etc.

I'm using 6.3-PRERELEASE as of Dec 6th, but a search for umass-related bugs

http://www.freebsd.org/cgi/query-pr-summary.cgi?text=umass

reveals plenty of really old problems, which don't even have a single
follow-up from FreeBSD-developers. Like:

http://www.freebsd.org/cgi/query-pr.cgi?pr=usb/95037
http://www.freebsd.org/cgi/query-pr.cgi?pr=usb/95173
http://www.freebsd.org/cgi/query-pr.cgi?pr=usb/107848

Looks like USB is unmaintained and getting worse. Are we really shipping this
as "the most recent stable release"?

-mi
_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"