From owner-freebsd-usb@FreeBSD.ORG Sun Nov 9 17:15:17 2008 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 EF43A10656A5; Sun, 9 Nov 2008 17:15:17 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-gx0-f13.google.com (mail-gx0-f13.google.com [209.85.217.13]) by mx1.freebsd.org (Postfix) with ESMTP id 5940B8FC0C; Sun, 9 Nov 2008 17:15:17 +0000 (UTC) (envelope-from onemda@gmail.com) Received: by gxk6 with SMTP id 6so1669717gxk.19 for ; Sun, 09 Nov 2008 09:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=2/7OKWFG1yMOcsbNj+E6gIT53km+K4NR4h0OzEZRO5A=; b=ws5hqAOfWPhosVlnEWnQ2raT3tjKIIZZ43sn4ld2OvouF0TDf/fHSruj9DgXoorTY5 +L5Bok2YpfzD7uq39xh7y8+ocBS/ReoRcsI9cVv0Eu1u8OhwHZJfbiLiJw3YU7aqY1mu XwrEMYMWlD/YnS+mNOauzj3NgBw1gwWkKBPRc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bdzOhTCXC0B4PwkBqxUTsynL9UX/rgHqB4X0A6YyVtvkzNFHyDz8U3rSwODbVLc6eD RP9b9NPCTb+J93IiqLWE/IQiGmDlVbSQVoC7AGJHPns0mdJT0HYpiAAvLqhKPZvR0t35 M9r5db+WsM3BpY0JxePbwkkK4A2DlndWj2gKc= Received: by 10.64.183.6 with SMTP id g6mr6002120qbf.17.1226250916207; Sun, 09 Nov 2008 09:15:16 -0800 (PST) Received: by 10.65.216.9 with HTTP; Sun, 9 Nov 2008 09:15:16 -0800 (PST) Message-ID: <3a142e750811090915u389a3bfeqf4a13fc8b6c70c5d@mail.gmail.com> Date: Sun, 9 Nov 2008 18:15:16 +0100 From: "Paul B. Mahol" To: "Hans Petter Selasky" In-Reply-To: <200811091039.55889.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3a142e750811071154y5108f299h60bb7c1060f4567e@mail.gmail.com> <200811072236.38267.hselasky@c2i.net> <3a142e750811081442kc746a41j41d3d46e6688033f@mail.gmail.com> <200811091039.55889.hselasky@c2i.net> Cc: freebsd-current@freebsd.org, freebsd-usb@freebsd.org Subject: Re: USB4BSD release candidate number 3 - request for review 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: Sun, 09 Nov 2008 17:15:18 -0000 On 11/9/08, Hans Petter Selasky wrote: > 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. Real source of problem was card itself (similar errors were happening in oldusb, linux and windows) Another card works fine. Sorry for the noise.