From owner-freebsd-usb@FreeBSD.ORG Tue Nov 15 20:43:05 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 D9174106566B for ; Tue, 15 Nov 2011 20:43:05 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1868FC1E for ; Tue, 15 Nov 2011 20:43:04 +0000 (UTC) X-T2-Spam-Status: No, hits=0.5 required=5.0 tests=ALL_TRUSTED, BAYES_60 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 203287606; Tue, 15 Nov 2011 21:43:02 +0100 From: Hans Petter Selasky To: Jan Henrik Sylvester Date: Tue, 15 Nov 2011 21:40:15 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EB2F85A.3060501@ixsystems.com> <201111051315.54807.hselasky@c2i.net> <4EC265AC.5080503@janh.de> In-Reply-To: <4EC265AC.5080503@janh.de> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111152140.16012.hselasky@c2i.net> Cc: Josh Paetzel , "xin@ixsystems.com" , d@delphij.net, freebsd-usb@freebsd.org Subject: Re: USB 3 issues 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: Tue, 15 Nov 2011 20:43:06 -0000 On Tuesday 15 November 2011 14:14:20 Jan Henrik Sylvester wrote: > On 11/05/2011 13:15, Hans Petter Selasky wrote: > > On Friday 04 November 2011 12:33:53 Jan Henrik Sylvester wrote: > >> On 11/04/2011 10:18, Hans Petter Selasky wrote: > >>> On Thursday 03 November 2011 22:04:44 Xin LI wrote: > >>>> Xin LI > >>> > >>> Please try the following patch: > >>> > >>> http://svn.freebsd.org/changeset/base/227075 > >>> > >>> Then send me the XHCI attach error. > >>> > >>> Probably something which we can fix. > >> > >> Ok, I have found a minute to test 9.0-RC1 + 227075: > >> > >> xhci0: mem 0xf1f00000-0xf1f0ffff irq > >> 19 at device 0.0 on pci5 > >> xhci0: 32 byte context size. > >> xhci0: Controller reset timeout. > >> xhci0: XHCI halt/start/probe failed err=18 > >> WARNING: A USB process has been left suspended > >> device_attach: xhci0 attach returned 6 > >> > >> BTW: I think it is this device from "pciconf -l": > >> xhci0@pci0:5:0:0: class=0x0c0330 card=0x10001d5c chip=0x10001b73 > >> rev=0x01 hdr=0x00 > > > > In sys/dev/usb/controller/xhci.c > > > > Try to increase the usb_pause_mtx() from hz/1000 to hz/100. > > > > If that doesn't work try to continue, even if the HC is not clearing the > > HCRST bit. Also print "temp" at the end of the loop. > > > > /* Reset controller */ > > XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); > > > > for (i = 0; i != 100; i++) { > > > > usb_pause_mtx(NULL, hz / 1000); > > temp = XREAD4(sc, oper, XHCI_USBCMD)& > > (XHCI_CMD_HCRST | XHCI_STS_CNR); > > if (!temp) > > > > break; > > > > } > > > > if (temp) { > > > > device_printf(sc->sc_bus.parent, "Controller " > > > > "reset timeout.\n"); > > > > return (USB_ERR_IOERROR); > > > > } > > I have put hz/100 in all four places of usb_pause_mtx(), replacing > hz/1000 three times and hz/250 once. temp is never != 0 in that loop now > and the controller attaches: > > xhci0: mem 0xf1f00000-0xf1f0ffff irq > 19 at d > evice 0.0 on pci5 > xhci0: 32 byte context size. > usbus1 on xhci0 > > Anyhow, trying to attach an umass device fails: > > xhci_do_command: Command timeout! > xhci_do_command: Command timeout! > xhci_do_command: Command timeout! > ugen1.2: at usbus1 > umass0: on usbus1 > umass0: SCSI over Bulk-Only; quirks = 0x0000 > xhci_do_command: Command timeout! > xhci_do_command: Command timeout! > umass0: Get Max Lun not supported (USB_ERR_TIMEOUT) > umass0:5:0:-1: Attached to scbus5 > xhci_do_command: Command timeout! > Hi, > And many more "Command timeout!" after that. Can you compile the kernel with "options USB_DEBUG" in the kernel configuration file and set hw.usb.xhci.debug=15 during bootup? I will get those delay changes into the mainline code. --HPS