netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Mike McCormack <mikem@ring3k.org>
Subject: [PATCH 3/9] sky2: Reset tx train after interrupts disabled.
Date: Fri, 14 Aug 2009 08:15:14 -0700	[thread overview]
Message-ID: <20090814151608.115603088@vyatta.com> (raw)
In-Reply-To: 20090814151511.992669598@vyatta.com

[-- Attachment #1: sky2-tx3.patch --]
[-- Type: text/plain, Size: 1532 bytes --]

From:	Mike McCormack <mikem@ring3k.org>

Reseting the tx chain too soon results in invalid tx queue positions
being delivered in the status queue.  This also makes sure there's no
overlap between the cleanup done by sky2_tx_clean() and
sky2_tx_done().

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/sky2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/sky2.c	2009-08-14 07:58:44.833439109 -0700
+++ b/drivers/net/sky2.c	2009-08-14 07:58:45.736296852 -0700
@@ -1804,11 +1804,8 @@ static void sky2_tx_clean(struct net_dev
 	netif_tx_unlock_bh(dev);
 }
 
-static void sky2_tx_reset(struct sky2_port* sky2)
+static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)
 {
-	unsigned port = sky2->port;
-	struct sky2_hw *hw = sky2->hw;
-
 	/* Disable Force Sync bit and Enable Alloc bit */
 	sky2_write8(hw, SK_REG(port, TXA_CTRL),
 		    TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC);
@@ -1866,8 +1863,6 @@ static int sky2_down(struct net_device *
 	      && port == 0 && hw->dev[1] && netif_running(hw->dev[1])))
 		sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET);
 
-	sky2_tx_reset(sky2);
-
 	sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
 
 	/* Force any delayed status interrrupt and NAPI */
@@ -1892,6 +1887,8 @@ static int sky2_down(struct net_device *
 	/* turn off LED's */
 	sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
 
+	sky2_tx_reset(hw, port);
+
 	sky2_tx_clean(dev);
 	sky2_rx_clean(sky2);
 

-- 


  parent reply	other threads:[~2009-08-14 15:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14 15:15 [PATCH 0/9] sky2: version 1.24 Stephen Hemminger
2009-08-14 15:15 ` [PATCH 1/9] sky2: Avoid rewinding sky2->tx_prod Stephen Hemminger
2009-08-14 15:15 ` [PATCH 2/9] sky2: Move tx reset functionality to sky2_tx_reset() Stephen Hemminger
2009-08-14 15:15 ` Stephen Hemminger [this message]
2009-08-14 15:15 ` [PATCH 4/9] sky2: hold spinlock around phy_power_down Stephen Hemminger
2009-08-14 15:15 ` [PATCH 5/9] sky2: hold RTNL when doing suspend/shutdown operations Stephen Hemminger
2009-08-14 15:15 ` [PATCH 6/9] sky2: cleanup restart operations Stephen Hemminger
2009-08-14 15:15 ` [PATCH 7/9] sky2: lock less transmit completion Stephen Hemminger
2009-08-14 15:15 ` [PATCH 8/9] sky2: fix pause negotiation Stephen Hemminger
2009-08-14 15:15 ` [PATCH 9/9] sky2: version 1.24 Stephen Hemminger
2009-08-14 22:41 ` [PATCH 0/9] " David Miller
2009-08-14 23:33   ` [PATCH] sky2: remove restarting workaround flag Stephen Hemminger
2009-08-14 23:38     ` David Miller

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=20090814151608.115603088@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=mikem@ring3k.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).