From owner-svn-src-stable@FreeBSD.ORG Wed Dec 9 22:41:51 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68F71065692; Wed, 9 Dec 2009 22:41:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D43A28FC23; Wed, 9 Dec 2009 22:41:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB9Mfoct042357; Wed, 9 Dec 2009 22:41:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MfoM5042353; Wed, 9 Dec 2009 22:41:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092241.nB9MfoM5042353@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200333 - in stable/8/sys/dev: pci usb/controller X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:41:51 -0000 Author: thompsa Date: Wed Dec 9 22:41:50 2009 New Revision: 200333 URL: http://svn.freebsd.org/changeset/base/200333 Log: MFC r199814 Disable interrupts after doing early takeover of the usb controller in case usb isnt actually compiled in (or kldloaded) as the controller could cause spurious interrupts. Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/usb/controller/uhci_pci.c stable/8/sys/dev/usb/controller/uhcireg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Wed Dec 9 22:41:11 2009 (r200332) +++ stable/8/sys/dev/pci/pci.c Wed Dec 9 22:41:50 2009 (r200333) @@ -2610,6 +2610,8 @@ ohci_early_takeover(device_t self) "SMM does not respond, resetting\n"); bus_write_4(res, OHCI_CONTROL, OHCI_HCFS_RESET); } + /* Disable interrupts */ + bus_write_4(res, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); @@ -2619,6 +2621,9 @@ ohci_early_takeover(device_t self) static void uhci_early_takeover(device_t self) { + struct resource *res; + int rid; + /* * 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 @@ -2626,6 +2631,14 @@ uhci_early_takeover(device_t self) * to the ports of the root hub? */ pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); + + /* Disable interrupts */ + rid = PCI_UHCI_BASE_REG; + res = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res != NULL) { + bus_write_2(res, UHCI_INTR, 0); + bus_release_resource(self, SYS_RES_IOPORT, rid, res); + } } /* Perform early EHCI takeover from SMM. */ @@ -2637,6 +2650,7 @@ ehci_early_takeover(device_t self) uint32_t eec; uint8_t eecp; uint8_t bios_sem; + uint8_t offs; int rid; int i; @@ -2676,6 +2690,9 @@ ehci_early_takeover(device_t self) printf("ehci early: " "SMM does not respond\n"); } + /* Disable interrupts */ + offs = bus_read_1(res, EHCI_CAPLENGTH); + bus_write_4(res, offs + EHCI_USBINTR, 0); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); } Modified: stable/8/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci_pci.c Wed Dec 9 22:41:11 2009 (r200332) +++ stable/8/sys/dev/usb/controller/uhci_pci.c Wed Dec 9 22:41:50 2009 (r200333) @@ -88,8 +88,6 @@ __FBSDID("$FreeBSD$"); /* PIIX4E has no separate stepping */ -#define PCI_UHCI_BASE_REG 0x20 - static device_probe_t uhci_pci_probe; static device_attach_t uhci_pci_attach; static device_detach_t uhci_pci_detach; Modified: stable/8/sys/dev/usb/controller/uhcireg.h ============================================================================== --- stable/8/sys/dev/usb/controller/uhcireg.h Wed Dec 9 22:41:11 2009 (r200332) +++ stable/8/sys/dev/usb/controller/uhcireg.h Wed Dec 9 22:41:50 2009 (r200333) @@ -39,6 +39,8 @@ #ifndef _UHCIREG_H_ #define _UHCIREG_H_ +#define PCI_UHCI_BASE_REG 0x20 + /* PCI config registers */ #define PCI_USBREV 0x60 /* USB protocol revision */ #define PCI_USB_REV_MASK 0xff