[PATCH 2/2] sky2: fix transmit state on resume

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephen Hemminger
Date: Thursday, September 27, 2007 - 12:38 pm

This should fix http://bugzilla.kernel.org/show_bug.cgi?id=8667

After resume, driver has reset the chip so the current state
of transmit checksum offload state machine and DMA state machine
will be undefined.

The fix is to set the state so that first Tx will set MSS and offset
values.

Patch is against 2.6.23-rc8 after last patch:
 sky2: FE+ vlan workaround

(Should also work on older releases with minor fuzz).

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2007-09-27 08:45:13.000000000 -0700
+++ b/drivers/net/sky2.c	2007-09-27 09:39:49.000000000 -0700
@@ -910,6 +910,20 @@ static inline struct sky2_tx_le *get_tx_
 	return le;
 }
 
+static void tx_init(struct sky2_port *sky2)
+{
+	struct sky2_tx_le *le;
+
+	sky2->tx_prod = sky2->tx_cons = 0;
+	sky2->tx_tcpsum = 0;
+	sky2->tx_last_mss = 0;
+
+	le = get_tx_le(sky2);
+	le->addr = 0;
+	le->opcode = OP_ADDR64 | HW_OWNER;
+	sky2->tx_addr64 = 0;
+}
+
 static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2,
 					    struct sky2_tx_le *le)
 {
@@ -1320,7 +1334,8 @@ static int sky2_up(struct net_device *de
 				GFP_KERNEL);
 	if (!sky2->tx_ring)
 		goto err_out;
-	sky2->tx_prod = sky2->tx_cons = 0;
+
+	tx_init(sky2);
 
 	sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES,
 					   &sky2->rx_le_map);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] sky2: sky2 FE+ receive status workaround, Stephen Hemminger, (Wed Sep 26, 5:58 pm)
Re: [PATCH] sky2: sky2 FE+ receive status workaround, Jochen Voß, (Thu Sep 27, 1:14 am)
Re: [PATCH] sky2: sky2 FE+ receive status workaround, Stephen Hemminger, (Thu Sep 27, 6:58 am)
Re: [PATCH] sky2: sky2 FE+ receive status workaround, Jochen Voss, (Thu Sep 27, 8:23 am)
[PATCH 1/2] sky2: FE+ vlan workaround, Stephen Hemminger, (Thu Sep 27, 12:32 pm)
[PATCH 2/2] sky2: fix transmit state on resume, Stephen Hemminger, (Thu Sep 27, 12:38 pm)
Re: [PATCH] sky2: sky2 FE+ receive status workaround, Jeff Garzik, (Thu Sep 27, 8:33 pm)
Re: [PATCH 1/2] sky2: FE+ vlan workaround, Jeff Garzik, (Thu Sep 27, 8:35 pm)
Re: [PATCH 2/2] sky2: fix transmit state on resume, Jeff Garzik, (Thu Sep 27, 8:35 pm)