shithub: riscv

Download patch

ref: b267359b69cb5b04f500a145e3c9c2bab813274e
parent: abf197c3237a1274018fdb26baa3f11c303bc258
author: aiju <devnull@localhost>
date: Sun Apr 24 13:23:17 EDT 2011

fixed interrupt problem with BCM driver on multicore machines

--- a/sys/src/9/pc/etherbcm.c
+++ b/sys/src/9/pc/etherbcm.c
@@ -22,7 +22,7 @@
 
 typedef struct Ctlr Ctlr;
 struct Ctlr {
-	Lock txlock;
+	Lock txlock, imlock;
 	Ctlr *link;
 	Pcidev *pdev;
 	ulong *nic, *status;
@@ -404,6 +404,7 @@
 	
 	edev = arg;
 	ctlr = edev->ctlr;
+	ilock(&ctlr->imlock);
 	dummyread(csr32(ctlr, InterruptMailbox));
 	csr32(ctlr, InterruptMailbox) = 1;
 	status = ctlr->status[0];
@@ -416,6 +417,7 @@
 	bcmtransclean(edev);
 	bcmtransmit(edev);
 	csr32(ctlr, InterruptMailbox) = tag << 24;
+	iunlock(&ctlr->imlock);
 }
 
 static void
@@ -664,5 +666,5 @@
 void
 etherbcmlink(void)
 {
-	addethercard("BCM57xx", bcmpnp);
+	addethercard("BCM5755", bcmpnp);
 }