aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike McCormack <mikem@ring3k.org>2009-08-14 01:15:14 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-14 18:30:00 -0400
commit264bb4fab1a0952b4eef4df5b9e90bc050a2d1e6 (patch)
treeb7546998044c84af5aa2432a0f80fcb833948b50 /drivers
parenta510996bea68eec2feb7818e9a440bd840613a25 (diff)
sky2: Reset tx train after interrupts disabled.
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sky2.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 768ed47da9bd..b75b48e83970 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1811,11 +1811,8 @@ static void sky2_tx_clean(struct net_device *dev)
1811 netif_tx_unlock_bh(dev); 1811 netif_tx_unlock_bh(dev);
1812} 1812}
1813 1813
1814static void sky2_tx_reset(struct sky2_port* sky2) 1814static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)
1815{ 1815{
1816 unsigned port = sky2->port;
1817 struct sky2_hw *hw = sky2->hw;
1818
1819 /* Disable Force Sync bit and Enable Alloc bit */ 1816 /* Disable Force Sync bit and Enable Alloc bit */
1820 sky2_write8(hw, SK_REG(port, TXA_CTRL), 1817 sky2_write8(hw, SK_REG(port, TXA_CTRL),
1821 TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); 1818 TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC);
@@ -1877,8 +1874,6 @@ static int sky2_down(struct net_device *dev)
1877 && port == 0 && hw->dev[1] && netif_running(hw->dev[1]))) 1874 && port == 0 && hw->dev[1] && netif_running(hw->dev[1])))
1878 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); 1875 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET);
1879 1876
1880 sky2_tx_reset(sky2);
1881
1882 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); 1877 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
1883 1878
1884 /* Force any delayed status interrrupt and NAPI */ 1879 /* Force any delayed status interrrupt and NAPI */
@@ -1903,6 +1898,8 @@ static int sky2_down(struct net_device *dev)
1903 /* turn off LED's */ 1898 /* turn off LED's */
1904 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); 1899 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
1905 1900
1901 sky2_tx_reset(hw, port);
1902
1906 sky2_tx_clean(dev); 1903 sky2_tx_clean(dev);
1907 sky2_rx_clean(sky2); 1904 sky2_rx_clean(sky2);
1908 1905