netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] backport of sky2 stability fixes
@ 2007-08-16 13:12 Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 1/4] sky2: restore workarounds for lost interrupts Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-08-16 13:12 UTC (permalink / raw)
  To: stable; +Cc: netdev

These are bugfixes that happened late in 2.6.22 cycle that missed
getting merged.

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] sky2: restore workarounds for lost interrupts
  2007-08-16 13:12 [PATCH 0/4] backport of sky2 stability fixes Stephen Hemminger
@ 2007-08-16 13:12 ` Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 2/4] sky2: carrier management Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-08-16 13:12 UTC (permalink / raw)
  To: stable; +Cc: netdev

[-- Attachment #1: sky2-lost-irq.patch --]
[-- Type: text/plain, Size: 1351 bytes --]

Backport of commit c59697e06058fc2361da8cefcfa3de85ac107582

This patch restores a couple of workarounds from 2.6.16:
 * restart transmit moderation timer in case it expires during IRQ routine
 * default to having 10 HZ watchdog timer.
At this point it more important not to hang than to worry about the
power cost.
    
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2007-08-08 21:50:10.000000000 +0100
+++ b/drivers/net/sky2.c	2007-08-08 22:01:00.000000000 +0100
@@ -96,7 +96,7 @@ static int disable_msi = 0;
 module_param(disable_msi, int, 0);
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
-static int idle_timeout = 0;
+static int idle_timeout = 100;
 module_param(idle_timeout, int, 0);
 MODULE_PARM_DESC(idle_timeout, "Watchdog timer for lost interrupts (ms)");
 
@@ -2442,6 +2442,13 @@ static int sky2_poll(struct net_device *
 
 	work_done = sky2_status_intr(hw, work_limit);
 	if (work_done < work_limit) {
+		/* Bug/Errata workaround?
+		 * Need to kick the TX irq moderation timer.
+		 */
+		if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
+			sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
+			sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
+		}
 		netif_rx_complete(dev0);
 
 		/* end of interrupt, re-enables also acts as I/O synchronization */

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] sky2: carrier management
  2007-08-16 13:12 [PATCH 0/4] backport of sky2 stability fixes Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 1/4] sky2: restore workarounds for lost interrupts Stephen Hemminger
@ 2007-08-16 13:12 ` Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 3/4] sky2: check for more work before leaving NAPI Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 4/4] sky2: check drop truncated packets Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-08-16 13:12 UTC (permalink / raw)
  To: stable; +Cc: netdev

[-- Attachment #1: sky2-carrier-mgmt.patch --]
[-- Type: text/plain, Size: 1917 bytes --]

backport of commit 55d7b4e6ed6ad3ec5e5e30b3b4515a0a6a53e344
    
Make sky2 handle carrier similar to other drivers,
eliminate some possible races in carrier state transistions.
    
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2007-08-08 22:01:00.000000000 +0100
+++ b/drivers/net/sky2.c	2007-08-08 22:01:11.000000000 +0100
@@ -1234,6 +1234,8 @@ static int sky2_up(struct net_device *de
 	if (netif_msg_ifup(sky2))
 		printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
 
+	netif_carrier_off(dev);
+
 	/* must be power of 2 */
 	sky2->tx_le = pci_alloc_consistent(hw->pdev,
 					   TX_RING_SIZE *
@@ -1573,7 +1575,6 @@ static int sky2_down(struct net_device *
 
 	/* Stop more packets from being queued */
 	netif_stop_queue(dev);
-	netif_carrier_off(dev);
 
 	/* Disable port IRQ */
 	imask = sky2_read32(hw, B0_IMSK);
@@ -1625,6 +1626,8 @@ static int sky2_down(struct net_device *
 
 	sky2_phy_power(hw, port, 0);
 
+	netif_carrier_off(dev);
+
 	/* turn off LED's */
 	sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
 
@@ -1689,7 +1692,6 @@ static void sky2_link_up(struct sky2_por
 	gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK);
 
 	netif_carrier_on(sky2->netdev);
-	netif_wake_queue(sky2->netdev);
 
 	/* Turn on link LED */
 	sky2_write8(hw, SK_REG(port, LNK_LED_REG),
@@ -1741,7 +1743,6 @@ static void sky2_link_down(struct sky2_p
 	gma_write16(hw, port, GM_GP_CTRL, reg);
 
 	netif_carrier_off(sky2->netdev);
-	netif_stop_queue(sky2->netdev);
 
 	/* Turn on link LED */
 	sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF);
@@ -3493,10 +3494,6 @@ static __devinit struct net_device *sky2
 	memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8, ETH_ALEN);
 	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 
-	/* device is off until link detection */
-	netif_carrier_off(dev);
-	netif_stop_queue(dev);
-
 	return dev;
 }
 

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] sky2: check for more work before leaving NAPI
  2007-08-16 13:12 [PATCH 0/4] backport of sky2 stability fixes Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 1/4] sky2: restore workarounds for lost interrupts Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 2/4] sky2: carrier management Stephen Hemminger
@ 2007-08-16 13:12 ` Stephen Hemminger
  2007-08-16 13:12 ` [PATCH 4/4] sky2: check drop truncated packets Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-08-16 13:12 UTC (permalink / raw)
  To: stable; +Cc: netdev

[-- Attachment #1: sky2-napi-fill.patch --]
[-- Type: text/plain, Size: 2050 bytes --]

Backport of commit 5c11ce700f77fada15b6264417d72462da4bbb1c
    
This patch avoids generating another IRQ if more packets
arrive while in the NAPI poll routine. Before marking device as
finished, it rechecks that the status ring is empty.
    
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2007-08-08 22:01:11.000000000 +0100
+++ b/drivers/net/sky2.c	2007-08-08 22:01:28.000000000 +0100
@@ -2428,8 +2428,7 @@ static void sky2_err_intr(struct sky2_hw
 static int sky2_poll(struct net_device *dev0, int *budget)
 {
 	struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw;
-	int work_limit = min(dev0->quota, *budget);
-	int work_done = 0;
+	int work_done;
 	u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
 
 	if (unlikely(status & Y2_IS_ERROR))
@@ -2441,25 +2440,25 @@ static int sky2_poll(struct net_device *
 	if (status & Y2_IS_IRQ_PHY2)
 		sky2_phy_intr(hw, 1);
 
-	work_done = sky2_status_intr(hw, work_limit);
-	if (work_done < work_limit) {
-		/* Bug/Errata workaround?
-		 * Need to kick the TX irq moderation timer.
-		 */
-		if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
-			sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
-			sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
-		}
-		netif_rx_complete(dev0);
+	work_done = sky2_status_intr(hw, min(dev0->quota, *budget));
+	*budget -= work_done;
+	dev0->quota -= work_done;
 
-		/* end of interrupt, re-enables also acts as I/O synchronization */
-		sky2_read32(hw, B0_Y2_SP_LISR);
-		return 0;
-	} else {
-		*budget -= work_done;
-		dev0->quota -= work_done;
+	/* More work? */
+ 	if (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX))
 		return 1;
+
+	/* Bug/Errata workaround?
+	 * Need to kick the TX irq moderation timer.
+	 */
+	if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
+		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
+		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
 	}
+	netif_rx_complete(dev0);
+
+	sky2_read32(hw, B0_Y2_SP_LISR);
+	return 0;
 }
 
 static irqreturn_t sky2_intr(int irq, void *dev_id)

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] sky2: check drop truncated packets
  2007-08-16 13:12 [PATCH 0/4] backport of sky2 stability fixes Stephen Hemminger
                   ` (2 preceding siblings ...)
  2007-08-16 13:12 ` [PATCH 3/4] sky2: check for more work before leaving NAPI Stephen Hemminger
@ 2007-08-16 13:12 ` Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-08-16 13:12 UTC (permalink / raw)
  To: stable; +Cc: netdev

[-- Attachment #1: sky2-stable-trunc.patch --]
[-- Type: text/plain, Size: 909 bytes --]

Backport of commit 71749531f2d1954137a1a77422ef4ff29eb102dd
    
If packet larger than MTU is received, the driver uses hardware to
truncate the packet. Use the status registers to catch/drop them.
    
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2007-08-08 22:01:28.000000000 +0100
+++ b/drivers/net/sky2.c	2007-08-08 22:01:37.000000000 +0100
@@ -2065,6 +2065,9 @@ static struct sk_buff *sky2_receive(stru
 	if (!(status & GMR_FS_RX_OK))
 		goto resubmit;
 
+	if (status >> 16 != length)
+		goto len_mismatch;
+
 	if (length < copybreak)
 		skb = receive_copy(sky2, re, length);
 	else
@@ -2074,6 +2077,11 @@ resubmit:
 
 	return skb;
 
+len_mismatch:
+	/* Truncation of overlength packets
+	   causes PHY length to not match MAC length */
+	++sky2->net_stats.rx_length_errors;
+
 error:
 	++sky2->net_stats.rx_errors;
 	if (status & GMR_FS_RX_FF_OV) {

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-16 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 13:12 [PATCH 0/4] backport of sky2 stability fixes Stephen Hemminger
2007-08-16 13:12 ` [PATCH 1/4] sky2: restore workarounds for lost interrupts Stephen Hemminger
2007-08-16 13:12 ` [PATCH 2/4] sky2: carrier management Stephen Hemminger
2007-08-16 13:12 ` [PATCH 3/4] sky2: check for more work before leaving NAPI Stephen Hemminger
2007-08-16 13:12 ` [PATCH 4/4] sky2: check drop truncated packets Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).