netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 03/20] sky2: restore workarounds for lost interrupts
       [not found] ` <20070821065210.GA5275@kroah.com>
@ 2007-08-21  6:53   ` Greg KH
  2007-08-21  6:54   ` [patch 04/20] sky2: carrier management Greg KH
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2007-08-21  6:53 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, netdev,
	Stephen Hemminger, Greg Kroah-Hartman

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

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stephen Hemminger <shemminger@linux-foundation.org>

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/sky2.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -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] 7+ messages in thread

* [patch 04/20] sky2: carrier management
       [not found] ` <20070821065210.GA5275@kroah.com>
  2007-08-21  6:53   ` [patch 03/20] sky2: restore workarounds for lost interrupts Greg KH
@ 2007-08-21  6:54   ` Greg KH
  2007-08-21  6:54   ` [patch 05/20] sky2: check for more work before leaving NAPI Greg KH
  2007-08-21  6:54   ` [patch 06/20] sky2: check drop truncated packets Greg KH
  3 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2007-08-21  6:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, netdev,
	Stephen Hemminger, Greg Kroah-Hartman

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

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stephen Hemminger <shemminger@linux-foundation.org>

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/sky2.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -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] 7+ messages in thread

* [patch 05/20] sky2: check for more work before leaving NAPI
       [not found] ` <20070821065210.GA5275@kroah.com>
  2007-08-21  6:53   ` [patch 03/20] sky2: restore workarounds for lost interrupts Greg KH
  2007-08-21  6:54   ` [patch 04/20] sky2: carrier management Greg KH
@ 2007-08-21  6:54   ` Greg KH
  2007-08-21  6:54   ` [patch 06/20] sky2: check drop truncated packets Greg KH
  3 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2007-08-21  6:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, netdev,
	Stephen Hemminger, Greg Kroah-Hartman

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

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stephen Hemminger <shemminger@linux-foundation.org>

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/sky2.c |   35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -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] 7+ messages in thread

* [patch 06/20] sky2: check drop truncated packets
       [not found] ` <20070821065210.GA5275@kroah.com>
                     ` (2 preceding siblings ...)
  2007-08-21  6:54   ` [patch 05/20] sky2: check for more work before leaving NAPI Greg KH
@ 2007-08-21  6:54   ` Greg KH
  2007-08-21 18:10     ` [PATCH] sky2: don't clear phy power bits Stephen Hemminger
  3 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2007-08-21  6:54 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, netdev,
	Stephen Hemminger, Greg Kroah-Hartman

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

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stephen Hemminger <shemminger@linux-foundation.org>

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/sky2.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -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] 7+ messages in thread

* [PATCH] sky2: don't clear phy power bits
  2007-08-21  6:54   ` [patch 06/20] sky2: check drop truncated packets Greg KH
@ 2007-08-21 18:10     ` Stephen Hemminger
  2007-08-21 18:26       ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2007-08-21 18:10 UTC (permalink / raw)
  To: Greg KH
  Cc: stable, stable, Justin Forbes, Zwane Mwaikambo, Theodore Ts'o,
	Randy Dunlap, Dave Jones, Chuck Wolber, Chris Wedgwood,
	Michael Krufky, Chuck Ebbert, Domenico Andreoli, torvalds, akpm,
	alan, netdev, Greg Kroah-Hartman

There are special PHY settings available on Yukon EC-U chip that
should not get cleared. This should solve mysterious errors on some
motherboards (like Gigabyte DS-3).

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


--- a/drivers/net/sky2.c	2007-08-21 11:08:27.000000000 -0700
+++ b/drivers/net/sky2.c	2007-08-21 11:09:03.000000000 -0700
@@ -657,8 +657,8 @@ static void sky2_mac_init(struct sky2_hw
 	int i;
 	const u8 *addr = hw->dev[port]->dev_addr;
 
-	sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
-	sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
+	sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
+	sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
 
 	sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
 

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

* Re: [PATCH] sky2: don't clear phy power bits
  2007-08-21 18:10     ` [PATCH] sky2: don't clear phy power bits Stephen Hemminger
@ 2007-08-21 18:26       ` Linus Torvalds
  2007-08-21 18:50         ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2007-08-21 18:26 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Greg KH, stable, stable, Justin Forbes, Zwane Mwaikambo,
	Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
	Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli,
	akpm, alan, netdev



On Tue, 21 Aug 2007, Stephen Hemminger wrote:
>
> There are special PHY settings available on Yukon EC-U chip that
> should not get cleared. This should solve mysterious errors on some
> motherboards (like Gigabyte DS-3).

Ok, applied.

However:

 - now all accesses to GPHY_CTRL are 8-bit (it used to mix them). Good.

 - but sky2.h still says "32 bit" about the register

Should the comments in sky2.h perhaps be fixed?

		Linus

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

* Re: [PATCH] sky2: don't clear phy power bits
  2007-08-21 18:26       ` Linus Torvalds
@ 2007-08-21 18:50         ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2007-08-21 18:50 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Greg KH, stable, stable, Justin Forbes, Zwane Mwaikambo,
	Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
	Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli,
	akpm, alan, netdev

On Tue, 21 Aug 2007 11:26:23 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Tue, 21 Aug 2007, Stephen Hemminger wrote:
> >
> > There are special PHY settings available on Yukon EC-U chip that
> > should not get cleared. This should solve mysterious errors on some
> > motherboards (like Gigabyte DS-3).
> 
> Ok, applied.
> 
> However:
> 
>  - now all accesses to GPHY_CTRL are 8-bit (it used to mix them). Good.
> 
>  - but sky2.h still says "32 bit" about the register
> 
> Should the comments in sky2.h perhaps be fixed?
> 

Register is 32 bit, I'll add documentation about other bits.

-- 
Stephen Hemminger <shemminger@linux-foundation.org>

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

end of thread, other threads:[~2007-08-21 18:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070821064251.972690753@blue.kroah.org>
     [not found] ` <20070821065210.GA5275@kroah.com>
2007-08-21  6:53   ` [patch 03/20] sky2: restore workarounds for lost interrupts Greg KH
2007-08-21  6:54   ` [patch 04/20] sky2: carrier management Greg KH
2007-08-21  6:54   ` [patch 05/20] sky2: check for more work before leaving NAPI Greg KH
2007-08-21  6:54   ` [patch 06/20] sky2: check drop truncated packets Greg KH
2007-08-21 18:10     ` [PATCH] sky2: don't clear phy power bits Stephen Hemminger
2007-08-21 18:26       ` Linus Torvalds
2007-08-21 18:50         ` 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).