Subject: kern/21547: Reading short block from ugen device can lock up USB
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gson@gson.org>
List: netbsd-bugs
Date: 05/11/2003 23:21:48
>Number:         21547
>Category:       kern
>Synopsis:       Reading short block from ugen device can lock up USB
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 12 06:22:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Gustafsson
>Release:        NetBSD 1.6L
>Organization:
>Environment:
System: NetBSD guava.araneus.fi 1.6L NetBSD 1.6L (GUAVAMP) #0: Sun Jan 12 16:57:58 PST 2003 gson@guava.araneus.fi:/usr/src/sys/arch/i386/compile/GUAVAMP i386
Architecture: i386
Machine: i386
>Description:

I am trying to test an experimental USB device under NetBSD.  The
device periodically sends 64-byte packets over a bulk endpoint
(endpoint 1).  Reading the packets using "dd if=/dev/ugen0.01 bs=64
count=1" works fine.

If I specify a smaller block size like "dd if=/dev/ugen0.01 bs=63
count=1", I get an I/O error after a five-second timeout.  The I/O
error itself is expected, but the error also has the unexpected and
more serious effect of making any subsequent attempt to use USB fail,
even after unplugging the USB device.  No matter what I try to plug
into the USB port (after unplugging the device with which the I/O
error occurred), I get

  usbd_new_device: addr=2, getting first desc failed
  uhub_explore: usb_new_device failed, error=TIMEOUT
  uhub0: device problem, disabling port 1

The machine has two USB ports, and they both stop working.  The only
way to clear up the problem is to reboot.

The dmesg output for the host USB hardware is as follows:

  uhci0 at pci0 dev 7 function 2: VIA Technologies VT83C572 USB Controller (rev. 0x06)
  uhci0: interrupting at irq 11
  usb0 at uhci0: USB revision 1.0
  uhub0 at usb0
  uhub0: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
  uhub0: 2 ports with 2 removable, self powered

>How-To-Repeat:

See above.  Although the USB device in question is not available
commercially, the issue may be reproducible using other bulk devices,
or if necessary, I can make the device available to anyone who is
serious about looking into the issue.

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: