aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-02-29 15:53:25 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-02-29 15:53:25 +0000
commit0186b0e50eeda8ba55001a78e1ff552800ac291e (patch)
treeb8d723eae9d93552dbd78ef915659be0cac01130 /target
parent43869ba1b27ba99da612e6afc0a7c7a3f30fec1a (diff)
downloadupstream-0186b0e50eeda8ba55001a78e1ff552800ac291e.tar.gz
upstream-0186b0e50eeda8ba55001a78e1ff552800ac291e.tar.bz2
upstream-0186b0e50eeda8ba55001a78e1ff552800ac291e.zip
ar71xx: reset ethernet tx ring on fast reset to prevent packet loss / irq issues
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Backport of r48753 git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@48815 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index fbd6bef63d..f06ef3455b 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -498,14 +498,16 @@ static void ag71xx_fast_reset(struct ag71xx *ag)
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
struct net_device *dev = ag->dev;
u32 reset_mask = pdata->reset_bit;
- u32 rx_ds, tx_ds;
+ u32 rx_ds;
u32 mii_reg;
reset_mask &= AR71XX_RESET_GE0_MAC | AR71XX_RESET_GE1_MAC;
+ ag71xx_hw_stop(ag);
+ wmb();
+
mii_reg = ag71xx_rr(ag, AG71XX_REG_MII_CFG);
rx_ds = ag71xx_rr(ag, AG71XX_REG_RX_DESC);
- tx_ds = ag71xx_rr(ag, AG71XX_REG_TX_DESC);
ath79_device_reset_set(reset_mask);
udelay(10);
@@ -515,13 +517,16 @@ static void ag71xx_fast_reset(struct ag71xx *ag)
ag71xx_dma_reset(ag);
ag71xx_hw_setup(ag);
ag71xx_tx_packets(ag, true);
+ ag->tx_ring.curr = 0;
+ ag->tx_ring.dirty = 0;
+ netdev_reset_queue(ag->dev);
/* setup max frame length */
ag71xx_wr(ag, AG71XX_REG_MAC_MFL,
ag71xx_max_frame_len(ag->dev->mtu));
ag71xx_wr(ag, AG71XX_REG_RX_DESC, rx_ds);
- ag71xx_wr(ag, AG71XX_REG_TX_DESC, tx_ds);
+ ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->tx_ring.descs_dma);
ag71xx_wr(ag, AG71XX_REG_MII_CFG, mii_reg);
ag71xx_hw_set_macaddr(ag, dev->dev_addr);
@@ -942,6 +947,9 @@ static int ag71xx_tx_packets(struct ag71xx *ag, bool flush)
break;
}
+ if (flush)
+ desc->ctrl |= DESC_EMPTY;
+
n++;
if (!skb)
continue;