From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 22 12:50:27 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8AC1616A4CE for ; Fri, 22 Oct 2004 12:50:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F15E43D41 for ; Fri, 22 Oct 2004 12:50:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9MCoRGl034484 for ; Fri, 22 Oct 2004 12:50:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9MCoRXQ034480; Fri, 22 Oct 2004 12:50:27 GMT (envelope-from gnats) Resent-Date: Fri, 22 Oct 2004 12:50:27 GMT Resent-Message-Id: <200410221250.i9MCoRXQ034480@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Daan Vreeken [PA4DAN]" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAD3C16A4CE for ; Fri, 22 Oct 2004 12:42:38 +0000 (GMT) Received: from amsfep18-int.chello.nl (amsfep18-int.chello.nl [213.46.243.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CF0A43D2F for ; Fri, 22 Oct 2004 12:42:37 +0000 (GMT) (envelope-from pa4dan@Vitsch.net) Received: from Vitsch.net ([212.187.78.35]) by amsfep18-int.chello.nl (InterMail vM.6.01.03.04 201-2131-111-106-20040729) with ESMTP id <20041022124235.UCN3605.amsfep18-int.chello.nl@Vitsch.net> for ; Fri, 22 Oct 2004 14:42:35 +0200 Received: (from pa4dan@localhost) by Vitsch.net (8.12.3p2/8.11.3) id i9MCgXnF078625; Fri, 22 Oct 2004 14:42:33 +0200 (CEST) (envelope-from pa4dan) Message-Id: <200410221242.i9MCgXnF078625@Vitsch.net> Date: Fri, 22 Oct 2004 14:42:33 +0200 (CEST) From: "Daan Vreeken [PA4DAN]" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/73000: UHCI driver fails to detect (certain) interrupts on boot X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Daan Vreeken \[PA4DAN\]" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Oct 2004 12:50:27 -0000 >Number: 73000 >Category: kern >Synopsis: UHCI driver fails to detect (certain) interrupts on boot >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 22 12:50:27 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Daan Vreeken [PA4DAN] >Release: FreeBSD 5.1-RELEASE i386 >Organization: >Environment: System: FreeBSD Racebeest.Danovitsch.LAN 5.1-RELEASE FreeBSD 5.1-RELEASE #18: Thu Oct 7 11:39:42 CEST 2004 root@Racebeest.Danovitsch.LAN:/usr/src.5.1/sys/i386/compile/Laptop i386 >Description: During boot the UHCI driver uses the routine uhci_waitintr() to detect interrupts (since interrupts are disabled at that point). The routine checks the UHCI interrupt status register and if it detects an interrupt condition it manually calls uhci_intr1() to handle the interrupt. The fault is that uhci_waitintr() only checks for UHCI_STS_USBINTR and not all other interrupt flags (like UHCI_STS_USBEI). This causes interrupts to be ignored (if UHCI_STS_USBINTR isn't set). Having an axe(4) USB ethernet adapter plugged in during boot causes the system to freeze (for a very long period of time) during initialisation of the device. Eventually uhci_waitintr() will timeout, but that can take up to minutes per request. When using a USB WLAN device with my own driver ( http://vitsch.net/bsd/atuwi ) causes the system to stall for hours at boot, since the driver does about 100 USB requests during attach. >How-To-Repeat: Plugin an axe(4) or atuwi device into a system with a UHCI controller (not sure if all UHCI controllers exhibit the same behaviour) and boot the system. Booting should take minutes up to hours. >Fix: Apply the following patch (to -current). The patch makes uhci_waitintr() and uhci_poll() aware of all interrupt flags in the interrupt status register instead of just UHCI_STS_USBINT. --- uhci-waitintr-2004-10-22.diff begins here --- --- uhci.c.org Fri Oct 22 12:16:29 2004 +++ uhci.c Fri Oct 22 12:21:11 2004 @@ -1552,7 +1552,7 @@ for (; timo >= 0; timo--) { usb_delay_ms(&sc->sc_bus, 1); DPRINTFN(20,("uhci_waitintr: 0x%04x\n", UREAD2(sc, UHCI_STS))); - if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT) + if (UREAD2(sc, UHCI_STS) & UHCI_STS_ALLINTRS) uhci_intr1(sc); if (xfer->status != USBD_IN_PROGRESS) return; @@ -1576,7 +1576,7 @@ { uhci_softc_t *sc = (uhci_softc_t *)bus; - if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT) + if (UREAD2(sc, UHCI_STS) & UHCI_STS_ALLINTRS) uhci_intr1(sc); } --- uhci-waitintr-2004-10-22.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: