changeset 10591:2e4b69967f09

6863918 bfe doesnt appear to like suspend and resume 6882713 BCM4401 chips should attach using device-id 0x170c rather than using sub-system device-id
author Saurabh Misra <Saurabh.Mishra@Sun.COM>
date Mon, 21 Sep 2009 09:38:11 -0700
parents 43ff5881adbb
children 62ea4b0f9248
files usr/src/pkgdefs/SUNWbfe/postinstall.tmpl usr/src/uts/common/io/bfe/bfe.c
diffstat 2 files changed, 28 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/pkgdefs/SUNWbfe/postinstall.tmpl	Mon Sep 21 08:42:30 2009 -0700
+++ b/usr/src/pkgdefs/SUNWbfe/postinstall.tmpl	Mon Sep 21 09:38:11 2009 -0700
@@ -25,4 +25,4 @@
 
 include drv_utils
 
-pkg_drvadd -i "pci14e4,970c" bfe || exit 1
+pkg_drvadd -i "pci14e4,170c" bfe || exit 1
--- a/usr/src/uts/common/io/bfe/bfe.c	Mon Sep 21 08:42:30 2009 -0700
+++ b/usr/src/uts/common/io/bfe/bfe.c	Mon Sep 21 09:38:11 2009 -0700
@@ -466,6 +466,7 @@
 bfe_timeout(void *arg)
 {
 	bfe_t *bfe = (bfe_t *)arg;
+	int resched = 0;
 
 	/*
 	 * We don't grab any lock because bfe can't go away.
@@ -524,6 +525,8 @@
 					OUTL(bfe, BFE_MAC_FLOW, flow);
 				}
 
+				resched = 1;
+
 				OUTL(bfe, BFE_TX_CTRL, val);
 				DTRACE_PROBE1(link__up,
 				    int, bfe->bfe_unit);
@@ -532,6 +535,9 @@
 	}
 
 	rw_exit(&bfe->bfe_rwlock);
+
+	if (resched)
+		mac_tx_update(bfe->bfe_machdl);
 }
 
 /*
@@ -1218,7 +1224,7 @@
 static int
 bfe_chip_start(bfe_t *bfe)
 {
-	bfe_grab_locks(bfe);
+	ASSERT_ALL_LOCKS(bfe);
 
 	/*
 	 * Stop the chip first & then Reset the chip. At last enable interrupts.
@@ -1245,10 +1251,6 @@
 	/* Check link, speed and duplex mode */
 	(void) bfe_check_link(bfe);
 
-	bfe_release_locks(bfe);
-
-	mac_tx_update(bfe->bfe_machdl);
-
 	return (DDI_SUCCESS);
 }
 
@@ -1845,8 +1847,15 @@
 {
 	bfe_t *bfe = (bfe_t *)arg;
 
-	if (bfe_chip_start(bfe) == DDI_FAILURE)
+	bfe_grab_locks(bfe);
+	if (bfe_chip_start(bfe) == DDI_FAILURE) {
+		bfe_release_locks(bfe);
 		return (EINVAL);
+	}
+
+	bfe_release_locks(bfe);
+
+	mac_tx_update(bfe->bfe_machdl);
 
 	return (0);
 }
@@ -1999,8 +2008,7 @@
 	mutex_enter(&r->r_lock);
 
 	if (bfe->bfe_chip_state != BFE_CHIP_ACTIVE) {
-		bfe_error(bfe->bfe_dip, "bfe_mac_transmit_packet(): sending pkt"
-		    " while chip/link is not up");
+		DTRACE_PROBE1(tx__chip__not__active, int, bfe->bfe_unit);
 
 		freemsgchain(mp);
 		mutex_exit(&r->r_lock);
@@ -2082,7 +2090,9 @@
 
 	if (intr_mask & BFE_ISTAT_RFO) {
 		bfe->bfe_stats.overflows++;
-		return;
+		bfe->bfe_chip_action |=
+		    (BFE_ACTION_RESTART | BFE_ACTION_RESTART_FAULT);
+		goto action;
 	}
 
 	if (intr_mask & BFE_ISTAT_TFU) {
@@ -2368,6 +2378,9 @@
 		return (DDI_INTR_UNCLAIMED);
 	}
 
+	DTRACE_PROBE2(bfe__interrupt, int, bfe->bfe_unit,
+	    int, intr_stat);
+
 	if (bfe->bfe_chip_state != BFE_CHIP_ACTIVE) {
 		/*
 		 * If chip is suspended then we just return.
@@ -2811,10 +2824,13 @@
 	if (bfe_chip_start(bfe) == DDI_FAILURE) {
 		bfe_error(dip, "Could not resume chip");
 		err = DDI_FAILURE;
-		goto done;
 	}
-done:
+
 	bfe_release_locks(bfe);
+
+	if (err == DDI_SUCCESS)
+		mac_tx_update(bfe->bfe_machdl);
+
 	return (err);
 }