Skip site navigation (1)Skip section navigation (2)
Date:      1 Aug 2002 16:46:09 -0000
From:      nivit@libero.it (Nicola Vitale)
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   misc/41243: USB, getting full desc failed, HID device, STALLED
Message-ID:  <20020801164609.740.qmail@Coryphantha.DOMO.SVA>

next in thread | raw e-mail | index | archive | help

>Number:         41243
>Category:       misc
>Synopsis:       USB, getting full desc failed, HID device, STALLED
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 01 13:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Nicola Vitale
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:

1) System: FreeBSD Coryphantha.DOMO.SVA 4.6-STABLE FreeBSD 4.6-STABLE #58: Thu Aug 1 16:00:40 CEST 2002 stan@Coryphantha.DOMO.SVA:/usr/obj/usr/src/sys/Coryphantha i386

2) Kernel configuration includes these lines:

	device          usb
	device          uhci
	device          ums
	device          uhid
	device          ugen

3) Hardware: USB graphic tablet (HID class)
   (http://www.trust.com/products/frame-product.htm?artnr=12050)

>Description:

	The host can not get the full descriptor from this device
	and so disables the port

uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xe000-0xe01f irq 11 at device 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
usbd_new_device: addr=2, getting full desc failed
uhub_explore: usb_new_device failed, error=STALLED
uhub0: device problem, disabling port 1

>How-To-Repeat:

>Fix:

	It seems that the device wants to be in Address state,
	before responding to a GET_DESCRIPTOR request;
	
	On the other hand, despite of this comment in

/*      $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.23.2.4 2002/02/24 14:23:15 alfred Exp $

/*
 * Called when a new device has been put in the powered state,
 * but not yet in the addressed state.
 * Get initial descriptor, set the address, get full descriptor,
 * and attach a driver.
 */

	the function usbd_new_device(), which returns error=STALLED,
	executes those tasks in this order:

	1) get initial descriptor
	2) get full descriptor
	3) set address
	4) attach a driver

Inverting the actions 2) and 3), the driver ums is attached to the device:

uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xe000-0xe01f irq 11 at device 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ums0: AIPTEK International Inc. USB Tablet Series Version 1.04, rev 1.10/1.03, addr 2, iclass 3/1
ums0: 7 buttons and Z dir.

--- src/sys/dev/usb/usb_subr.c	Thu Mar 28 23:25:06 2002
+++ src/sys/dev/usb/usb_subr.c.new	Wed Jul 31 17:40:27 2002
@@ -1020,14 +1020,6 @@
 
 	USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize);
 
-	err = usbd_reload_device_desc(dev);
-	if (err) {
-		DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
-			      "failed\n", addr));
-		usbd_remove_device(dev, up);
-		return (err);
-	}
-
 	/* Set the address */
 	err = usbd_set_address(dev, addr);
 	DPRINTFN(5,("usbd_new_device: setting device address=%d\n", addr));
@@ -1046,6 +1038,14 @@
 	/* Assume 100mA bus powered for now. Changed when configured. */
 	dev->power = USB_MIN_POWER;
 	dev->self_powered = 0;
+
+	err = usbd_reload_device_desc(dev);
+	if (err) {
+		DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
+			      "failed\n", addr));
+		usbd_remove_device(dev, up);
+		return (err);
+	}
 
 	DPRINTF(("usbd_new_device: new dev (addr %d), dev=%p, parent=%p\n", 
 		 addr, dev, parent));



	


	

	
	
	


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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020801164609.740.qmail>