Skip to contentSkip to conversation

forcedeth fix: tx/rx reset

PATCH In review Ayaz Abdulla 1 participant 2 messages Aug 25, 2008 – Aug 27, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 forcedeth fix: tx/rx reset

This patch keeps the HW reset for tx/rx asserted until DMA is enabled. This is to ensure that all tx/rx initialization (i.e ring setup) is finished before de-asserting the reset.

drivers/net/forcedeth.c +3 -8
@@ -233,7 +233,7 @@
 	NvRegTxRxControl = 0x144,
 #define NVREG_TXRXCTL_KICK	0x0001
 #define NVREG_TXRXCTL_BIT1	0x0002
-#define NVREG_TXRXCTL_BIT2	0x0004
+#define NVREG_TXRXCTL_DMA_DISABLE	0x0004
 #define NVREG_TXRXCTL_IDLE	0x0008
 #define NVREG_TXRXCTL_RESET	0x0010
 #define NVREG_TXRXCTL_RXCHECK	0x0400
@@ -1555,11 +1555,9 @@
 	u8 __iomem *base = get_hwbase(dev);
 
 	dprintk(KERN_DEBUG "%s: nv_txrx_reset\n", dev->name);
-	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_DMA_DISABLE | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
 	pci_push(base);
 	udelay(NV_TXRX_RESET_DELAY);
-	writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);
-	pci_push(base);
 }
 
 static void nv_mac_reset(struct net_device *dev)
@@ -1570,7 +1568,7 @@
 
 	dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name);
 
-	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_DMA_DISABLE | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
 	pci_push(base);
 
 	/* save registers since they will be cleared on reset */
@@ -1589,9 +1587,6 @@
 	writel(temp1, base + NvRegMacAddrA);
 	writel(temp2, base + NvRegMacAddrB);
 	writel(temp3, base + NvRegTransmitPoll);
-
-	writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);
-	pci_push(base);
 }
 
 static void nv_get_hw_stats(struct net_device *dev)
#1 lore raw

I am retracting this path for the time being because we believe there is other circumstances in play. Once the final root cause is found, I can send out the correct patch.

Ayaz

Quoted 53 lines · Ayaz Abdulla

This patch keeps the HW reset for tx/rx asserted until DMA is enabled. This is to ensure that all tx/rx initialization (i.e ring setup) is finished before de-asserting the reset.

------------------------------------------------------------------------

drivers/net/forcedeth.c +3 -8
@@ -233,7 +233,7 @@
 	NvRegTxRxControl = 0x144,
 #define NVREG_TXRXCTL_KICK	0x0001
 #define NVREG_TXRXCTL_BIT1	0x0002
-#define NVREG_TXRXCTL_BIT2	0x0004
+#define NVREG_TXRXCTL_DMA_DISABLE	0x0004
 #define NVREG_TXRXCTL_IDLE	0x0008
 #define NVREG_TXRXCTL_RESET	0x0010
 #define NVREG_TXRXCTL_RXCHECK	0x0400
@@ -1555,11 +1555,9 @@
 	u8 __iomem *base = get_hwbase(dev);
 
 	dprintk(KERN_DEBUG "%s: nv_txrx_reset\n", dev->name);
-	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_DMA_DISABLE | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
 	pci_push(base);
 	udelay(NV_TXRX_RESET_DELAY);
-	writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);
-	pci_push(base);
 }
 
 static void nv_mac_reset(struct net_device *dev)
@@ -1570,7 +1568,7 @@
 
 	dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name);
 
-	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_DMA_DISABLE | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
 	pci_push(base);
 
 	/* save registers since they will be cleared on reset */
@@ -1589,9 +1587,6 @@
 	writel(temp1, base + NvRegMacAddrA);
 	writel(temp2, base + NvRegMacAddrB);
 	writel(temp3, base + NvRegTransmitPoll);
-
-	writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);
-	pci_push(base);
 }
 
 static void nv_get_hw_stats(struct net_device *dev)