public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom•net>
To: jgarzik@pobox•com
Cc: netdev@vger•kernel.org, linuxppc-dev@ozlabs•org
Subject: [PATCH] [5/11] pasemi_mac: workaround for erratum 5971
Date: Tue, 2 Oct 2007 16:26:30 -0500	[thread overview]
Message-ID: <20071002212630.GF2282@lixom.net> (raw)
In-Reply-To: <20071002212421.GA2282@lixom.net>

pasemi_mac: workaround for erratum 5971

Implement workarounds for erratum 5971, where L2 hints aren't considered
properly unless the way hint is enabled on the interface. Since L2 isn't
setup to dedicate a way to headers, we need to reset the packet count
by hand so it won't run out of credits.

Signed-off-by: Olof Johansson <olof@lixom•net>

Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -239,7 +239,9 @@ static int pasemi_mac_setup_rx_resources
 			   PAS_DMA_RXINT_BASEU_SIZ(RX_RING_SIZE >> 3));
 
 	write_dma_reg(mac, PAS_DMA_RXINT_CFG(mac->dma_if),
-			   PAS_DMA_RXINT_CFG_DHL(2));
+			   PAS_DMA_RXINT_CFG_DHL(3) |
+			   PAS_DMA_RXINT_CFG_L2 |
+			   PAS_DMA_RXINT_CFG_LW);
 
 	ring->next_to_fill = 0;
 	ring->next_to_clean = 0;
@@ -589,6 +591,11 @@ static int pasemi_mac_clean_rx(struct pa
 		n += 2;
 	}
 
+	if (n > RX_RING_SIZE) {
+		/* Errata 5971 workaround: L2 target of headers */
+		write_iob_reg(mac, PAS_IOB_COM_PKTHDRCNT, 0);
+		n &= (RX_RING_SIZE-1);
+	}
 	mac->rx->next_to_clean = n;
 	pasemi_mac_replenish_rx_ring(mac->netdev, limit-count);
 
Index: k.org/drivers/net/pasemi_mac.h
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.h
+++ k.org/drivers/net/pasemi_mac.h
@@ -210,6 +210,8 @@ enum {
 #define    PAS_DMA_RXINT_CFG_DHL_S	24
 #define    PAS_DMA_RXINT_CFG_DHL(x)	(((x) << PAS_DMA_RXINT_CFG_DHL_S) & \
 					 PAS_DMA_RXINT_CFG_DHL_M)
+#define    PAS_DMA_RXINT_CFG_LW		0x00200000
+#define    PAS_DMA_RXINT_CFG_L2		0x00100000
 #define    PAS_DMA_RXINT_CFG_WIF	0x00000002
 #define    PAS_DMA_RXINT_CFG_WIL	0x00000001
 
@@ -315,6 +317,12 @@ enum {
 #define    PAS_STATUS_SOFT		0x4000000000000000ull
 #define    PAS_STATUS_INT		0x8000000000000000ull
 
+#define PAS_IOB_COM_PKTHDRCNT		0x120
+#define    PAS_IOB_COM_PKTHDRCNT_PKTHDR1_M	0x0fff0000
+#define    PAS_IOB_COM_PKTHDRCNT_PKTHDR1_S	16
+#define    PAS_IOB_COM_PKTHDRCNT_PKTHDR0_M	0x00000fff
+#define    PAS_IOB_COM_PKTHDRCNT_PKTHDR0_S	0
+
 #define PAS_IOB_DMA_RXCH_CFG(i)		(0x1100 + (i)*4)
 #define    PAS_IOB_DMA_RXCH_CFG_CNTTH_M		0x00000fff
 #define    PAS_IOB_DMA_RXCH_CFG_CNTTH_S		0

  parent reply	other threads:[~2007-10-02 21:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 21:24 [PATCH] [0/11] pasemi_mac: Patches for 2.6.24 Olof Johansson
2007-10-02 21:24 ` [PATCH] [1/11] pasemi_mac: basic error checking Olof Johansson
2007-10-03 17:50   ` Jeff Garzik
2007-10-02 21:25 ` [PATCH] [2/11] pasemi_mac: fix bug in receive buffer dma mapping Olof Johansson
2007-10-02 21:25 ` [PATCH] [3/11] pasemi_mac: rework ring management Olof Johansson
2007-10-02 21:26 ` [PATCH] [4/11] pasemi_mac: implement sg support Olof Johansson
2007-10-02 21:26 ` Olof Johansson [this message]
2007-10-02 21:26 ` [PATCH] [6/11] pasemi_mac: add local skb alignment Olof Johansson
2007-10-02 21:27 ` [PATCH] [7/11] pasemi_mac: further performance tweaks Olof Johansson
2007-10-02 21:27 ` [PATCH] [8/11] pasemi_mac: update todo list Olof Johansson
2007-10-02 21:27 ` [PATCH] [9/11] pasemi_mac: clear out old errors on interface open Olof Johansson
2007-10-03 17:46   ` Jeff Garzik
2007-10-03 18:02     ` Olof Johansson
2007-10-03 18:15       ` Jeff Garzik
2007-10-02 21:27 ` [PATCH] [10/11] pasemi_mac: use buffer index pointer in clean_rx() Olof Johansson
2007-10-02 21:28 ` [PATCH] [11/11] pasemi_mac: enable iommu support Olof Johansson
2007-10-03 17:47   ` Jeff Garzik
2007-10-03 18:03     ` [PATCH RESEND] " Olof Johansson
2007-10-03 18:19       ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071002212630.GF2282@lixom.net \
    --to=olof@lixom$(echo .)net \
    --cc=jgarzik@pobox$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox