From owner-svn-src-all@FreeBSD.ORG Thu Mar 29 15:33:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E6F31065670; Thu, 29 Mar 2012 15:33:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08AC68FC1B; Thu, 29 Mar 2012 15:33:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2TFXiD3099146; Thu, 29 Mar 2012 15:33:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2TFXisu099144; Thu, 29 Mar 2012 15:33:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203291533.q2TFXisu099144@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 29 Mar 2012 15:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233662 - head/sys/dev/pci 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: Thu, 29 Mar 2012 15:33:45 -0000 Author: hselasky Date: Thu Mar 29 15:33:44 2012 New Revision: 233662 URL: http://svn.freebsd.org/changeset/base/233662 Log: Fix for boot issue: Don't disable BARs on AGP devices. In general: Don't disable BARs on any PCI display devices, because doing that can sometimes cause the main memory bus to stop working, causing all memory reads to return nothing but 0xFFFFFFFF, even though the memory location was previously written. After a while a privileged instruction fault will appear and then nothing more can be debugged. The reason for this behaviour is unknown. MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Mar 29 14:53:14 2012 (r233661) +++ head/sys/dev/pci/pci.c Thu Mar 29 15:33:44 2012 (r233662) @@ -2590,6 +2590,27 @@ pci_write_bar(device_t dev, struct pci_m struct pci_devinfo *dinfo; int ln2range; + /* + * Don't disable BARs on AGP devices. In general: Don't + * disable BARs on any PCI display devices, because doing that + * can sometimes cause the main memory bus to stop working, + * causing all memory reads to return nothing but 0xFFFFFFFF, + * even though the memory location was previously written. + * After a while a privileged instruction fault will appear + * and then nothing more can be debugged. + * The reason for this behaviour is unknown. + */ + if (base == 0 && pci_get_class(dev) == PCIC_DISPLAY) { + device_printf(device_get_parent(dev), + "pci%d:%d:%d:%d BARs on display devices " + "should not be disabled.\n", + pci_get_domain(dev), + pci_get_bus(dev), + pci_get_slot(dev), + pci_get_function(dev)); + return; + } + /* The device ROM BAR is always a 32-bit memory BAR. */ dinfo = device_get_ivars(dev); if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg))