From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 14:58:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 313441065757; Fri, 25 Sep 2009 14:58:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04A8D8FC24; Fri, 25 Sep 2009 14:58:01 +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 n8PEw0RL031660; Fri, 25 Sep 2009 14:58:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PEw0sn031658; Fri, 25 Sep 2009 14:58:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251458.n8PEw0sn031658@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 14:58:00 +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: r197482 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/pci dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 14:58:01 -0000 Author: jhb Date: Fri Sep 25 14:58:00 2009 New Revision: 197482 URL: http://svn.freebsd.org/changeset/base/197482 Log: MFC 197406: Don't reread the command register to see if enabling I/O or memory decoding "took". Other OS's that I checked do not do this and it breaks some amdpm(4) devices. Prior to 7.2 we did not honor the error returned when this failed anyway, so this in effect restores previous behavior. Approved by: re (kib) Modified: 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/pci/pci.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Sep 25 13:51:01 2009 (r197481) +++ stable/8/sys/dev/pci/pci.c Fri Sep 25 14:58:00 2009 (r197482) @@ -2149,62 +2149,38 @@ pci_disable_busmaster_method(device_t de int pci_enable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_set_command_bit(dev, child, bit); - /* Some devices seem to need a brief stall here, what do to? */ - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) - return (0); - device_printf(child, "failed to enable %s mapping!\n", error); - return (ENXIO); + return (0); } int pci_disable_io_method(device_t dev, device_t child, int space) { - uint16_t command; uint16_t bit; - char *error; - - bit = 0; - error = NULL; switch(space) { case SYS_RES_IOPORT: bit = PCIM_CMD_PORTEN; - error = "port"; break; case SYS_RES_MEMORY: bit = PCIM_CMD_MEMEN; - error = "memory"; break; default: return (EINVAL); } pci_clear_command_bit(dev, child, bit); - command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); - if (command & bit) { - device_printf(child, "failed to disable %s mapping!\n", error); - return (ENXIO); - } return (0); }