From owner-p4-projects@FreeBSD.ORG Thu Oct 14 22:42:15 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A8137106566B; Thu, 14 Oct 2010 22:42:15 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ACFF106566C for ; Thu, 14 Oct 2010 22:42:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 3CD3C8FC08 for ; Thu, 14 Oct 2010 22:42:15 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id o9EMgFs7019706 for ; Thu, 14 Oct 2010 22:42:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o9EMgFVM019703 for perforce@freebsd.org; Thu, 14 Oct 2010 22:42:15 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 14 Oct 2010 22:42:15 GMT Message-Id: <201010142242.o9EMgFVM019703@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 184749 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 22:42:15 -0000 http://p4web.freebsd.org/@@184749?ac=10 Change 184749 by hselasky@hselasky_laptop001 on 2010/10/14 22:41:28 EHCI: Wait for IAA IRQ and not only the clearing of the IAAD bit in the CMD register, before issuing a new IAAD command. Might fix some IRQ-hang issues. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#62 edit .. //depot/projects/usb/src/sys/dev/usb/controller/ehci.h#20 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#62 (text+ko) ==== @@ -1589,6 +1589,10 @@ usb_callout_reset(&sc->sc_tmo_pcd, hz, (void *)&ehci_pcd_enable, sc); } + /* if there was a doorbell, clear the doorbell busy flag */ + if (status & EHCI_STS_IAA) + sc->sc_flags &= ~EHCI_SCFLG_IAADBUSY; + status &= ~(EHCI_STS_INT | EHCI_STS_ERRINT | EHCI_STS_PCD | EHCI_STS_IAA); if (status != 0) { @@ -2313,7 +2317,7 @@ * XXX Certain nVidia chipsets choke when using the IAAD * feature too frequently. */ - if (sc->sc_flags & EHCI_SCFLG_IAADBUG) + if (sc->sc_flags & (EHCI_SCFLG_IAADBUG | EHCI_SCFLG_IAADBUSY)) return; /* XXX Performance quirk: Some Host Controllers have a too low @@ -2321,8 +2325,10 @@ * Controller after queueing the BULK transfer. */ temp = EOREAD4(sc, EHCI_USBCMD); - if (!(temp & EHCI_CMD_IAAD)) + if (!(temp & EHCI_CMD_IAAD)) { EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD); + sc->sc_flags |= EHCI_SCFLG_IAADBUSY; + } } struct usb_pipe_methods ehci_device_bulk_methods = ==== //depot/projects/usb/src/sys/dev/usb/controller/ehci.h#20 (text+ko) ==== @@ -347,6 +347,7 @@ #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ #define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ #define EHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ +#define EHCI_SCFLG_IAADBUSY 0x0100 /* doorbell is busy */ uint8_t sc_offs; /* offset to operational registers */ uint8_t sc_doorbell_disable; /* set on doorbell failure */