changeset 4018:72f0f2d75d29

backout 6472670: causes 6545437
author dm120769
date Thu, 12 Apr 2007 13:01:05 -0700
parents 03d59df3a040
children da060775097e
files usr/src/pkgdefs/SUNWrmodr/i.bootenvrc usr/src/uts/intel/io/pci/pci_boot.c
diffstat 2 files changed, 22 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/pkgdefs/SUNWrmodr/i.bootenvrc	Thu Apr 12 11:39:20 2007 -0700
+++ b/usr/src/pkgdefs/SUNWrmodr/i.bootenvrc	Thu Apr 12 13:01:05 2007 -0700
@@ -3,8 +3,9 @@
 # CDDL HEADER START
 #
 # The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
 #
 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 # or http://www.opensolaris.org/os/licensing.
@@ -22,7 +23,7 @@
 #
 #ident	"%Z%%M%	%I%	%E% SMI"
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 while read src dest
@@ -30,8 +31,6 @@
 	if [ ! -f $dest ] ; then
 		# Initial installation
 		cp $src $dest
-		# Enable pci-renumber-buses property for initial install
-		echo setprop pci-renumber-buses 1 >> $dest
 	else
 		#
 		# Preserve the installed version of
@@ -93,34 +92,7 @@
 				echo $line >> $merge
 			fi
 		done
-
-		#
-		# Make sure the merged file has a pci-renumber-buses property.
-		# If $dest doesn't already have the property, add it to the
-		# merged file using the following rule:
-		# - if on a Sun Blade x8400, add "pci-renumber-buses=1"
-		# - on all other systems, add "pci-renumber-buses=0"
-		#
-		/usr/bin/nawk '{print $2}' $dest | \
-		    grep -w pci-renumber-buses > /dev/null
-		if [ $? != 0 ] ; then
-			# smbios parameters
-			smtype=SMB_TYPE_BASEBOARD
-			name="Sun Blade x8400 Server Module"
-			#
-			# if smbios fails, we're not on an x8400, so it's
-			# the same as grep not finding the x8400 ID
-			#
-			(/usr/sbin/smbios -t $smtype | \
-			    grep "$name") > /dev/null 2>&1
-			if [ $? != 0 ] ; then
-				val="0"
-			else
-				val="1"
-			fi
-			echo setprop pci-renumber-buses $val >> $merge
-		fi
-
+		
 		#
 		# copy the merged file to $dest
 		#
--- a/usr/src/uts/intel/io/pci/pci_boot.c	Thu Apr 12 11:39:20 2007 -0700
+++ b/usr/src/uts/intel/io/pci/pci_boot.c	Thu Apr 12 13:01:05 2007 -0700
@@ -98,7 +98,7 @@
 
 extern int pci_slot_names_prop(int, char *, int);
 
-/* set to 1 to force PCI peer-bus renumbering, -1 to prevent it */
+/* set non-zero to force PCI peer-bus renumbering */
 int pci_bus_always_renumber = 0;
 
 /* get the subordinate bus # for a root/peer bus */
@@ -289,35 +289,21 @@
 static int
 pci_bus_renumber()
 {
-	char *bus_prop;
-	long val;
+	ACPI_TABLE_HEADER *fadt;
 
-	/* allow over-ride via patchable variable */
-	if (pci_bus_always_renumber > 0)
+	if (pci_bus_always_renumber)
 		return (1);
-	else if (pci_bus_always_renumber < 0)
+
+	/* get the FADT */
+	if (AcpiGetFirmwareTable(FADT_SIG, 1, ACPI_LOGICAL_ADDRESSING,
+	    (ACPI_TABLE_HEADER **)&fadt) != AE_OK)
 		return (0);
 
-	/*
-	 * Get the "pci-renumber-buses" boot property
-	 * This property is set-up during installation;
-	 * upgraded systems disable re-numbering to avoid the
-	 * complication of changing physical device paths.
-	 *
-	 * If the "pci-renumber-buses" property is not found,
-	 * this suggests an incomplete BFU or failure during
-	 * upgrade.  In either case, default to "don't renumber"
-	 * so that a botched BFU/upgrade doesn't render a system
-	 * unbootable.
-	 */
-	val = 0;
-	if (ddi_prop_lookup_string(DDI_DEV_T_ANY, ddi_root_node(),
-	    DDI_PROP_DONTPASS, "pci-renumber-buses", &bus_prop) ==
-	    DDI_PROP_SUCCESS) {
-		(void) ddi_strtol(bus_prop, NULL, 0, &val);
-		ddi_prop_free(bus_prop);
-	}
-	return (val);
+	/* compare OEM Table ID to "SUNm31" */
+	if (strncmp("SUNm31", fadt->OemId, 6))
+		return (0);
+	else
+		return (1);
 }
 
 /*
@@ -335,6 +321,11 @@
 	int pci_regs[] = {0, 0, 0};
 	int	i, root_addr = 0;
 
+	/*
+	 * Currently, we only enable the re-numbering on specific
+	 * Sun machines; this is a work-around for the more complicated
+	 * issue of upgrade changing physical device paths
+	 */
 	if (!pci_bus_renumber())
 		return;