Subject: USB (forw) another bug + fix
To: None <tech-kern@netbsd.org>
From: Alfred Perlstein <alfred@freebsd.org>
List: tech-kern
Date: 02/25/2002 21:48:45
This fixes the hangs in the USB driver.

The code mistakenly uses USBD_DEFAULT_INTERVAL which is -1, however
timeout is unsigned resulting in an absurdly long timeout.  It really
wants to use USBD_DEFAULT_TIMEOUT.

After this I no longer get hung processes, however for some reason
the 3rd open of my printer makes it flake out.  It seems to be NetBSD's
fault because power cycling the printer doesn't help (port gets
disabled due to error), however power cycling the netbsd box fixes
things.

*sigh*  If anyone wants to know, i'm using an 'ohci' controller and
netbsd-current.

Index: usbdi.c
===================================================================
RCS file: /home/netcvs/syssrc/sys/dev/usb/usbdi.c,v
retrieving revision 1.97
diff -u -r1.97 usbdi.c
--- usbdi.c	2002/02/20 20:30:14	1.97
+++ usbdi.c	2002/02/26 05:56:10
@@ -926,7 +932,7 @@
 usbd_do_request(usbd_device_handle dev, usb_device_request_t *req, void *data)
 {
 	return (usbd_do_request_flags(dev, req, data, NULL, 0,
-				      USBD_DEFAULT_INTERVAL));
+				      USBD_DEFAULT_TIMEOUT));
 }
 
 usbd_status

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/