moused(8) ate my umass(4) devices, it's true!

Ulrich Spoerlein uspoerlein at gmail.com
Mon Dec 15 01:30:23 PST 2008


Hey all,

I've observed a very weird behaviour with my USB stick for quite a while
now (probably 4 months; sadly, I don't have any dates handy). Anyway, I
have this weird SUN Keyboard -> USB adapter, which offers an ukbd(4) and
ums(4) device to the system, although there is no mouse attached to the
Sun keyboard I'm using.

ukbd0: <vendor 0x0430 PS/2 KB & MS, class 0/0, rev 1.00/0.04, addr 3> on uhub4
kbd2 at ukbd0
ums0: <vendor 0x0430 PS/2 KB & MS, class 0/0, rev 1.00/0.04, addr 3> on uhub4
ums0: 3 buttons.

This worked fine on RELENG_7 till somewhere around summer. Now, whenever
there is a moused(8) listening on this fake ums(4) port, the umass(4)
device will get stuck somewhere in CAM-land. It probes fine:

Dec 14 10:24:49 roadrunner kernel: umass0: <Samsung YP-U2, class 0/0, rev 2.00/10.01, addr 6> on uhub4

but then only BBB bulk transfer timeout messages follow every so often.
The da0 device never shows up.

Dec 14 10:26:59 roadrunner kernel: umass0: BBB reset failed, TIMEOUT
Dec 14 10:27:04 roadrunner kernel: umass0: BBB bulk-in clear stall failed, IOERROR
Dec 14 10:27:04 roadrunner kernel: umass0: BBB bulk-out clear stall failed, IOERROR
Dec 14 10:28:09 roadrunner kernel: umass0: BBB reset failed, IOERROR
Dec 14 10:28:09 roadrunner kernel: umass0: BBB bulk-in clear stall failed, IOERROR
Dec 14 10:28:09 roadrunner kernel: umass0: BBB bulk-out clear stall failed, IOERROR
Dec 14 10:29:14 roadrunner kernel: umass0: BBB reset failed, IOERROR
Dec 14 10:29:14 roadrunner kernel: umass0: BBB bulk-in clear stall failed, IOERROR
Dec 14 10:29:14 roadrunner kernel: umass0: BBB bulk-out clear stall failed, IOERROR
Dec 14 10:30:19 roadrunner kernel: umass0: BBB reset failed, IOERROR
Dec 14 10:30:19 roadrunner kernel: umass0: BBB bulk-in clear stall failed, IOERROR
Dec 14 10:30:19 roadrunner kernel: umass0: BBB bulk-out clear stall failed, IOERROR
Dec 14 10:31:24 roadrunner kernel: umass0: BBB reset failed, IOERROR
Dec 14 10:31:24 roadrunner kernel: umass0: BBB bulk-in clear stall failed, IOERROR
Dec 14 10:31:24 roadrunner kernel: umass0: BBB bulk-out clear stall failed, IOERROR

I cannot unplug the USB stick (instant panic) and kldunloading umass is
also bad (instant panic). I have to reboot the system and remove the
device then.

Today, I figured out that it depends wholly on moused(8) running on that
unpopulated mouse port. Killing the moused process, which will start
automatically when ums0 attaches, before plugging in the umass device and
everybody is happy. I'm glad I found this workaround, but the situation
sucks anyway.

Other than binary searching the offending commit, what debugging could I
do? Would a ktrace of the moused(8) be helpful when attaching umass? Is
it perhaps polling the port too often waiting for a mouse to appear?

Also, can I somehow blacklist the mouse-port of this adapter? I do not
intend to use a 3 button Sun mouse, ever.

Cheers,
Ulrich Spoerlein
-- 
It is better to remain silent and be thought a fool,
than to speak, and remove all doubt.


More information about the freebsd-stable mailing list