changeset 10623:a08d4ae62796

6875281 prtdiag on M-series reports wrong information about the interleaving factor in some cases
author Justin Frank <Justin.Frank@Sun.COM>
date Wed, 23 Sep 2009 08:43:18 -0700
parents de30154fc5f5
children 5ccd6d7aa2d9
files usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c	Wed Sep 23 22:24:40 2009 +0800
+++ b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c	Wed Sep 23 08:43:18 2009 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
  * Opl Platform specific functions.
@@ -28,8 +28,6 @@
  *	machine_type == MTYPE_OPL
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -588,7 +586,10 @@
 	 * Obtain "mirror-mode" property from pseudo-mc.
 	 * cs_stat[0].dimms/i_factor represents interleave factor per
 	 * pseudo-mc node. Must use cs_stat[0].dimms since this will yield
-	 * interleave factor even if some DIMMs are isolated.
+	 * interleave factor even if some DIMMs are isolated, except for
+	 * the case where the entire memory group has been deconfigured (eg. due
+	 * to DIMM failure); in this case, we use the second memory group
+	 * (i.e. cs_stat[1]).
 	 *
 	 * Mirror mode:
 	 *   interleave factor = (# of DIMMs on cs_stat[0]/4)
@@ -597,7 +598,10 @@
 	 *   interleave factor = (# of DIMMs on cs_stat[0]/2)
 	 */
 
-	interleave = cs_stat[0].dimms/i_factor;
+	if (cs_stat[0].dimms == 0)
+		interleave = cs_stat[1].dimms/i_factor;
+	else
+		interleave = cs_stat[0].dimms/i_factor;
 
 
 	for (i = 0; i < ngrps; i++) {