From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 5 10:23:40 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29CBAFEA; Thu, 5 Mar 2015 10:23:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14BE5E56; Thu, 5 Mar 2015 10:23:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t25ANd3x065536; Thu, 5 Mar 2015 10:23:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t25ANdZw065531; Thu, 5 Mar 2015 10:23:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503051023.t25ANdZw065531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Mar 2015 10:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r279650 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 10:23:40 -0000 Author: hselasky Date: Thu Mar 5 10:23:38 2015 New Revision: 279650 URL: https://svnweb.freebsd.org/changeset/base/279650 Log: MFC r279544: Add quirk to disable 64-bit XHCI DMA after r276717. Requested by: Gary Jennejohn Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Mar 5 10:22:59 2015 (r279649) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Mar 5 10:23:38 2015 (r279650) @@ -87,19 +87,24 @@ __FBSDID("$FreeBSD$"); static int xhcidebug; static int xhciroute; static int xhcipolling; +static int xhcidma32; static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI controller"); + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI controller"); TUNABLE_INT("hw.usb.xhci.use_polling", &xhcipolling); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); +TUNABLE_INT("hw.usb.xhci.dma32", &xhcidma32); #else #define xhciroute 0 +#define xhcidma32 0 #endif #define XHCI_INTR_ENDPT 1 @@ -569,7 +574,7 @@ xhci_halt_controller(struct xhci_softc * } usb_error_t -xhci_init(struct xhci_softc *sc, device_t self) +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) { uint32_t temp; @@ -616,7 +621,8 @@ xhci_init(struct xhci_softc *sc, device_ } /* get DMA bits */ - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); Modified: stable/9/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.h Thu Mar 5 10:22:59 2015 (r279649) +++ stable/9/sys/dev/usb/controller/xhci.h Thu Mar 5 10:23:38 2015 (r279650) @@ -513,7 +513,7 @@ struct xhci_softc { uint8_t xhci_use_polling(void); usb_error_t xhci_halt_controller(struct xhci_softc *); -usb_error_t xhci_init(struct xhci_softc *, device_t); +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:22:59 2015 (r279649) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Mar 5 10:23:38 2015 (r279650) @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self)) { + if (xhci_init(sc, self, 0)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res);