[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MIPS kernel snapshots - 2.6.27-rc6



* Thomas Bogendoerfer <tsbogend@alpha.franken.de> [2008-09-14 21:56]:
> hmm, I've just checked git.kernel.org and 2.6.26 has the tulip MWI
> fix applied, while 2.6.25 doesn't. So if this patch is not applied
> to the 2.6.25 debian kernels, it might be worth a try to revert that
> patch.

Good point.  Although we had the tulip MWI fix in the Debian kernel
since forever, our version is quite different to the one that went into
2.6.26.

Sébastien, can you please try the package at
http://merkel.debian.org/~tbm/tmp/cobalt/linux-image-2.6.26-1-r5k-cobalt_2.6.26-5test_mipsel.deb
This doesn't include the tulip MWI fix from 2.6.26.

Thomas, the patch we had in 2.6.25 and earlier is attached.

-- 
Martin Michlmayr
http://www.cyrius.com/
## DP: TULIP_MWI fix for Cobalt
## DP: Patch author: Peter Horton <pdh@colonel-panic.org>
## DP: Upstream status: submitted to netdev
## Needs some more work, see:
# http://marc.info/?l=linux-netdev&m=114189714123684&w=2
# http://marc.info/?l=linux-netdev&m=114172397714060&w=2
# http://marc.info/?l=linux-netdev&m=114170396804444&w=2

This patch works around the MWI bug on the DC21143 rev 65 Tulip by ensuring
that the receive buffers don't end on a cache line boundary (as documented
in the errata).

This patch is required for the MIPs based Cobalt Qube/RaQ as supporting the
extra PCI commands seems to reduce the chance of a hard lockup between the
Tulip and the PCI bridge.

--- linux.git.orig/drivers/net/tulip/tulip_core.c	2006-01-29 21:43:40.000000000 +0000
+++ linux.git/drivers/net/tulip/tulip_core.c	2006-01-29 21:56:50.000000000 +0000
@@ -294,6 +294,8 @@
 	if (tp->mii_cnt  ||  (tp->mtable  &&  tp->mtable->has_mii))
 		iowrite32(0x00040000, ioaddr + CSR6);
 
+	printk(KERN_DEBUG "%s: CSR0 %08x\n", dev->name, tp->csr0);
+
 	/* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
 	iowrite32(0x00000001, ioaddr + CSR0);
 	udelay(100);
@@ -1155,8 +1157,10 @@
 	/* if we have any cache line size at all, we can do MRM */
 	csr0 |= MRM;
 
+#ifndef CONFIG_TULIP_MWI_DC21143
 	/* ...and barring hardware bugs, MWI */
 	if (!(tp->chip_id == DC21143 && tp->revision == 65))
+#endif
 		csr0 |= MWI;
 
 	/* set or disable MWI in the standard PCI command bit.
@@ -1182,7 +1186,7 @@
 	 */
 	switch (cache) {
 	case 8:
-		csr0 |= MRL | (1 << CALShift) | (16 << BurstLenShift);
+		csr0 |= MRL | (1 << CALShift) | (8 << BurstLenShift);
 		break;
 	case 16:
 		csr0 |= MRL | (2 << CALShift) | (16 << BurstLenShift);
Index: linux.git/drivers/net/tulip/tulip.h
===================================================================
--- linux.git.orig/drivers/net/tulip/tulip.h	2006-01-29 21:43:40.000000000 +0000
+++ linux.git/drivers/net/tulip/tulip.h	2006-01-29 21:52:01.000000000 +0000
@@ -262,7 +262,15 @@
 #define RX_RING_SIZE	128 
 #define MEDIA_MASK     31
 
-#define PKT_BUF_SZ		1536	/* Size of each temporary Rx buffer. */
+/* MWI can fail on 21143 rev 65 if the receive buffer ends
+   on a cache line boundary. Ensure it doesn't ...
+*/
+
+#ifdef CONFIG_TULIP_MWI_DC21143
+#define PKT_BUF_SZ		(1536 + 4)	/* Size of each temporary Rx buffer. */
+#else
+#define PKT_BUF_SZ		1536		/* Size of each temporary Rx buffer. */
+#endif
 
 #define TULIP_MIN_CACHE_LINE	8	/* in units of 32-bit words */
 
Index: linux.git/drivers/net/tulip/Kconfig
===================================================================
--- linux.git.orig/drivers/net/tulip/Kconfig	2006-01-29 21:48:09.000000000 +0000
+++ linux.git/drivers/net/tulip/Kconfig	2006-01-29 21:50:28.000000000 +0000
@@ -57,6 +57,16 @@
 
 	  If unsure, say N.
 
+config TULIP_MWI_DC21143
+	bool "Enable MWI workaround on dc21143 controllers"
+	depends on TULIP_MWI
+	help
+	  This enables a workaround for MWI ("New bus configuration") on DC21143
+	  controllers.  Normally MWI is disabled on these chips because of
+	  hardware errata.
+
+	  If unsure, say N.
+
 config TULIP_MMIO
 	bool "Use PCI shared mem for NIC registers"
 	depends on TULIP


Reply to: