Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2012 15:33:44 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233662 - head/sys/dev/pci
Message-ID:  <201203291533.q2TFXisu099144@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203291533.q2TFXisu099144>