From owner-freebsd-usb@FreeBSD.ORG Fri Dec 16 05:33:04 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE5131065678; Fri, 16 Dec 2011 05:33:04 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6458FC17; Fri, 16 Dec 2011 05:33:03 +0000 (UTC) Received: by wgbds13 with SMTP id ds13so2412434wgb.1 for ; Thu, 15 Dec 2011 21:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=G0Z1SPKkqjUJAXMXpKk9KMNixzwCxvoAx60PldVxx/g=; b=eV6VWp9FaDLXsQ0KmY1LiQ6R0R+el9Jv70YPAw2/SnVhNTgM+APWeNOv4rRsL77XML sq0k2t1DUOx/2AMi3kjwrORP9S54cSj3EAoooaakSChT5QM18QMaxY/hpkdAX+GUBs5C 67redY0CM3wLmeXutJ4T00s1Yjp+RRLWHTG7o= MIME-Version: 1.0 Received: by 10.180.104.2 with SMTP id ga2mr12158931wib.33.1324012027630; Thu, 15 Dec 2011 21:07:07 -0800 (PST) Received: by 10.216.65.145 with HTTP; Thu, 15 Dec 2011 21:07:07 -0800 (PST) Date: Thu, 15 Dec 2011 23:07:07 -0600 Message-ID: From: Brandon Gooch To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Hans Petter Selasky Subject: xhci_do_command: Command timeout! X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2011 05:33:05 -0000 I recently enabled the "USB 3.0" option in the BIOS of my notebook. This transforms two of my USB 2.0 ports into USB 3.0 ports -- I'm already a little leery of it in that regard. When I boot, I see xhci(4) attach. However, when I plug in a device (such as my HTC phone), I see the following: xhci_do_command: Command timeout! usb_alloc_device: set address 2 failed (USB_ERR_TIMEOUT, ignored) xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT xhci_do_command: Command timeout! xhci_do_command: Command timeout! usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored) xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT xhci_do_command: Command timeout! xhci_do_command: Command timeout! usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored) xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! xhci_do_command: Command timeout! usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_TIMEOUT ugen1.2: at usbus1 (disconnected) xhci_do_command: Command timeout! uhub_reattach_port: could not allocate new device xhci_do_command: Command timeout! usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored) ugen1.2: at usbus1 (disconnected) uhub_reattach_port: could not allocate new device My kernel version: FreeBSD m6500.local 9.0-RC3 FreeBSD 9.0-RC3 #1 r228305M: Thu Dec 15 21:38:20 CST 2011 root@m6500.local:/usr/obj/usr/src/sys/DELL_M6500 amd64 I'm looking for some hints on where to start looking/hacking, or what further information may be useful (and where to get it). Again, I have to assume that since XHCI is an option in the BIOS, this must be some quirky piece of hardware I'm working with. Oh, and, I guess I need to know what I'm looking for when I try to identify the actual hardware (usbconfig?). Also, I tried and failed at this again with the following changes (gleaned from HEAD): Index: xhci.c =================================================================== --- xhci.c (revision 228305) +++ xhci.c (working copy) @@ -292,7 +292,7 @@ XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBCMD) & (XHCI_CMD_HCRST | XHCI_STS_CNR); if (!temp) @@ -453,7 +453,7 @@ XHCI_CMD_INTE | XHCI_CMD_HSEE); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; if (!temp) break; @@ -487,7 +487,7 @@ XWRITE4(sc, oper, XHCI_USBCMD, 0); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; if (temp) break; @@ -1127,7 +1127,7 @@ trb.dwTrb2 = 0; trb.dwTrb3 = htole32(XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_ENABLE_SLOT)); - err = xhci_do_command(sc, &trb, 50 /* ms */); + err = xhci_do_command(sc, &trb, 100 /* ms */); if (err) goto done; @@ -1154,7 +1154,7 @@ trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1310,7 +1310,7 @@ trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1328,7 +1328,7 @@ XHCI_TRB_3_SLOT_SET(slot_id); trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1351,7 +1351,7 @@ trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1373,7 +1373,7 @@ XHCI_TRB_3_EP_SET(ep_id); trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1396,7 +1396,7 @@ trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1414,7 +1414,7 @@ trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } /*------------------------------------------------------------------------* There seem to be other changes made as well, which I haven't had the time to try. Some of these changes are stated to be MFC'd -- will they make it into 9.0-RELEASE (or a Release Candidate for testing)? A few examples: http://svnweb.freebsd.org/base?view=revision&revision=227396 http://svnweb.freebsd.org/base?view=revision&revision=227401 http://svnweb.freebsd.org/base?view=revision&revision=227404 ...or a really good one: http://svnweb.freebsd.org/base?view=revision&revision=228483 -Brandon