From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 16:38:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E2B0D92A; Mon, 7 Jan 2013 16:38:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D50C8683; Mon, 7 Jan 2013 16:38:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07GcD0F020353; Mon, 7 Jan 2013 16:38:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07GcDga020351; Mon, 7 Jan 2013 16:38:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301071638.r07GcDga020351@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 7 Jan 2013 16:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245132 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 16:38:14 -0000 Author: hselasky Date: Mon Jan 7 16:38:13 2013 New Revision: 245132 URL: http://svnweb.freebsd.org/changeset/base/245132 Log: Optimise the XHCI interrupt handling. This patch will save CPU time when the XHCI interrupt is shared with other devices. Only check event rings when interrupt bits are set. Otherwise would indicate hiding possible hardware fault(s). Tested by: sos @ Submitted by: sos @ MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Jan 7 15:46:10 2013 (r245131) +++ head/sys/dev/usb/controller/xhci.c Mon Jan 7 16:38:13 2013 (r245132) @@ -1459,7 +1459,9 @@ xhci_interrupt(struct xhci_softc *sc) DPRINTFN(16, "real interrupt (sts=0x%08x, " "iman=0x%08x)\n", status, temp); - if (status != 0) { + if (status & (XHCI_STS_PCD | XHCI_STS_HCH | + XHCI_STS_HSE | XHCI_STS_HCE)) { + if (status & XHCI_STS_PCD) { xhci_root_intr(sc); } @@ -1480,7 +1482,9 @@ xhci_interrupt(struct xhci_softc *sc) } } - xhci_interrupt_poll(sc); + /* check if we need to check the event rings */ + if ((status != 0) || (temp & XHCI_IMAN_INTR_PEND)) + xhci_interrupt_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); }