changeset 12673:e579258c2bb7

6956591 bge driver stops working in nv140
author yong tan - Sun Microsystems - Beijing China <Yong.Tan@Sun.COM>
date Tue, 22 Jun 2010 14:06:24 +0800
parents 5b2e7f4e0c90
children fb4985fff3dd
files usr/src/uts/common/io/bge/bge_chip2.c usr/src/uts/common/io/bge/bge_main2.c usr/src/uts/common/io/bge/bge_send.c
diffstat 3 files changed, 7 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/bge/bge_chip2.c	Mon Jun 21 23:02:14 2010 -0700
+++ b/usr/src/uts/common/io/bge/bge_chip2.c	Tue Jun 22 14:06:24 2010 +0800
@@ -2598,6 +2598,7 @@
 		drv_usecwait(100);
 	}
 
+	bge_problem(bgep, "bge_chip_poll_engine failed: regno = 0x%lx", regno);
 	bge_fm_ereport(bgep, DDI_FM_DEVICE_NO_RESPONSE);
 	return (B_FALSE);
 }
@@ -3168,27 +3169,12 @@
 	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/
--- a/usr/src/uts/common/io/bge/bge_main2.c	Mon Jun 21 23:02:14 2010 -0700
+++ b/usr/src/uts/common/io/bge/bge_main2.c	Tue Jun 22 14:06:24 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"
@@ -3504,6 +3503,8 @@
 	if (err != 0)
 		goto attach_fail;
 
+	mac_link_update(bgep->mh, LINK_STATE_UNKNOWN);
+
 	/*
 	 * Register a periodical handler.
 	 * bge_chip_cyclic() is invoked in kernel context.
--- a/usr/src/uts/common/io/bge/bge_send.c	Mon Jun 21 23:02:14 2010 -0700
+++ b/usr/src/uts/common/io/bge/bge_send.c	Tue Jun 22 14:06:24 2010 +0800
@@ -614,8 +614,9 @@
 	ASSERT(bgep->bge_mac_state == BGE_MAC_STARTED);
 
 	rw_enter(bgep->errlock, RW_READER);
-	if (bgep->bge_chip_state != BGE_CHIP_RUNNING) {
-		BGE_DEBUG(("bge_m_tx: chip not running"));
+	if ((bgep->bge_chip_state != BGE_CHIP_RUNNING) ||
+	    !(bgep->param_link_up)) {
+		BGE_DEBUG(("bge_m_tx: chip not running or link down"));
 		freemsgchain(mp);
 		mp = NULL;
 	}