changeset 12331:d1dfa74bf947

6753086 iobustest netlbtest causes spurious ereport / fault on unplumbed bge devices
author yong tan - Sun Microsystems - Beijing China <Yong.Tan@Sun.COM>
date Fri, 07 May 2010 13:50:25 +0800
parents e4f9a0025b49
children f73240ab5ca7
files usr/src/uts/common/io/bge/bge_chip2.c
diffstat 1 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/bge/bge_chip2.c	Thu May 06 19:17:59 2010 -0700
+++ b/usr/src/uts/common/io/bge/bge_chip2.c	Fri May 07 13:50:25 2010 +0800
@@ -20,8 +20,7 @@
  */
 
 /*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #include "bge_impl.h"
@@ -937,7 +936,7 @@
 		data <<= 32;
 		data |= ddi_get32(bgep->io_handle, PIO_ADDR(bgep, addr));
 	} else {
-			data = ddi_get64(bgep->io_handle, PIO_ADDR(bgep, addr));
+		data = ddi_get64(bgep->io_handle, PIO_ADDR(bgep, addr));
 	}
 #elif defined(__sparc)
 	if (DEVICE_5723_SERIES_CHIPSETS(bgep) ||
@@ -948,9 +947,9 @@
 		    PIO_ADDR(bgep, addr + 4));
 	} else {
 		data = ddi_get64(bgep->io_handle, PIO_ADDR(bgep, addr));
-		}
+	}
 #else
-		data = ddi_get64(bgep->io_handle, PIO_ADDR(bgep, addr));
+	data = ddi_get64(bgep->io_handle, PIO_ADDR(bgep, addr));
 #endif
 
 	BGE_TRACE(("bge_nic_get64($%p, 0x%lx) = 0x%016llx",
@@ -3169,12 +3168,27 @@
 	bge_regno_t regno;
 	bge_regno_t *rbp;
 	boolean_t ok;
+	uint_t asf_mode;
 
 	BGE_TRACE(("bge_chip_stop($%p)",
 	    (void *)bgep));
 
 	ASSERT(mutex_owned(bgep->genlock));
 
+	/*
+	 * In some case, some chips' internal engines may fail to reset,
+	 * so we call bge_chip_reset as a workaround.
+	 */
+	bgep->bge_chip_state = BGE_CHIP_RESET;
+#ifdef BGE_IPMI_ASF
+	asf_mode = bgep->asf_enabled? ASF_MODE_POST_INIT: ASF_MODE_NONE;
+	if (bge_chip_reset(bgep, B_TRUE, asf_mode) != DDI_SUCCESS)
+#else
+	if (bge_chip_reset(bgep, B_TRUE) != DDI_SUCCESS)
+#endif
+		ddi_fm_service_impact(bgep->devinfo,
+		    DDI_SERVICE_UNAFFECTED);
+
 	rbp = shutdown_engine_regs;
 	/*
 	 * When driver try to shutdown the BCM5705/5788/5721/5751/