From owner-freebsd-current@FreeBSD.ORG Sun Nov 9 09:37:47 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1F9C1065680; Sun, 9 Nov 2008 09:37:47 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swipnet.se [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id D58698FC1B; Sun, 9 Nov 2008 09:37:46 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=bdeZpJpNa0wA:10 a=SER6hIBTabIA:10 a=d6BVkb5LuPPVEe4iNQMLyA==:17 a=GVVtOPgssA86c3O9foEA:9 a=1D2jOXY6p8Fq7yK9v-IA:7 a=FUBW0jyTs4d4kPHOJPs0fQ9R9XYA:4 a=9aOQ2cSd83gA:10 a=cvZW9r6VXHAA:10 a=LY0hPdMaydYA:10 Received: from [62.113.135.6] (account mc467741@c2i.net [62.113.135.6] verified) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 401096190; Sun, 09 Nov 2008 10:37:45 +0100 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Sun, 9 Nov 2008 10:39:55 +0100 User-Agent: KMail/1.9.7 References: <3a142e750811071154y5108f299h60bb7c1060f4567e@mail.gmail.com> <200811072236.38267.hselasky@c2i.net> <3a142e750811081442kc746a41j41d3d46e6688033f@mail.gmail.com> In-Reply-To: <3a142e750811081442kc746a41j41d3d46e6688033f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811091039.55889.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: USB4BSD release candidate number 3 - request for review X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 09:37:47 -0000 On Saturday 08 November 2008, Paul B. Mahol wrote: > On 11/7/08, Hans Petter Selasky wrote: > > On Friday 07 November 2008, Paul B. Mahol wrote: > >> On 11/7/08, M. Warner Losh wrote: > >> > : > After some time it will appear but will start attaching and > >> > : > dettaching all the time: > > > > How quick is this happening? There has been some changes to the > > sys/dev/usb2/core/uhub2.c file recently, which control how HUB is > > responding to events. > > ~3 seconds. > > I got also this messages: > > uhci1: LegSup = 0x2f00 ^^^^ Legacy support is complaining about something! > uhci_interrupt: host controller halted > uhci_dumpregs:705: usbus1 regs: cmd=0000, sts=0020, intr=0000, > frnum=0000, flbase=3f7fa000, sof=0040, portsc1=0080, portsc2=0080 > uhci_dump_qh:779: QH(0xc627e900) at 0x05a7e902: h_next=0x05a7db82 > e_next=0x00000001 > uhci_dump_qh:779: QH(0xc627db80) at 0x05a7db82: h_next=0x05a7dc02 > e_next=0x00000001 > uhci_dump_qh:779: QH(0xc627dc00) at 0x05a7dc02: h_next=0x05a7dc82 > e_next=0x00000001 > uhci_dump_qh:779: QH(0xc627dc80) at 0x05a7dc82: h_next=0x00000001 > e_next=0x05a7dd00 > uhci_interrupt: host controller halted > uhci_dumpregs:705: usbus1 regs: cmd=0000, sts=0020, intr=0000, > frnum=0000, flbase=3f7fa000, sof=0040, portsc1=0080, portsc2=0080 > uhci_dump_qh:779: QH(0xc627e900) at 0x05a7e902: h_next=0x05a7db82 > e_next=0x00000001 > uhci_dump_qh:779: QH(0xc627db80) at 0x05a7db82: h_next=0x05a7dc02 > e_next=0x00000001 > uhci_dump_qh:779: QH(0xc627dc00) at 0x05a7dc02: h_next=0x05a7dc82 > e_next=0x00000001 > uhci_dump_qh:779: QH(0xc627dc80) at 0x05a7dc82: h_next=0x00000001 > e_next=0x05a7dd00 > > Doesnt looks like hub is source of fault, one from perforce with > 152460 comitt is not available > in CURRENT and with latest version of usb2_hub.c from perforce problem > is still there. > > > Maybe you can get the date of that file from the build where it works and > > the > > build where it doesn't work, and I will check the differences. > > Last time I tested usb2 from svn was before huge modularization. Yes, then it probably has something to do with Legacy USB support. Some suggestions: 0) Have you tried putting the USB modules in the kernel ? 1) Try not loading the EHCI driver. Does the UHCI driver work without the host controller halted error? 2) sys/dev/usb2/controller/uhci2_pci.c Try moving the pci_read/pci_write lines before the IRQ is setup: #if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl); #else err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl); #endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->sc_intr_hdl = NULL; goto error; } /* * Set the PIRQD enable bit and switch off all the others. We don't * want legacy support to interfere with us XXX Does this also mean * that the BIOS won't touch the keyboard anymore if it is connected * to the ports of the root hub? */ #if USB_DEBUG if (pci_read_config(self, PCI_LEGSUP, 2) != PCI_LEGSUP_USBPIRQDEN) { device_printf(self, "LegSup = 0x%04x\n", pci_read_config(self, PCI_LEGSUP, 2)); } #endif pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); 3) There has been some changes to the EHCI legacy support code recently. Try the same in EHCI: Move "ehci_pci_takecontroller" before the IRQ is setup: sys/dev/usb2/controller/ehci2_pci.c #if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); #else err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); #endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->sc_intr_hdl = NULL; goto error; } ehci_pci_takecontroller(self); You only need to recompile and reinstall the USB2 modules after these changes. Try one suggestion at a time so that we can do some elimination. --HPS