From: Alexander Kochetkov Date: Tue, 9 Feb 2016 15:20:39 +0000 (+0300) Subject: UPSTREAM: net: arc_emac: reset txbd_curr and txbd_dirty pointers to zero X-Git-Tag: firefly_0821_release~2567 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a1f14d6216762bc9ba14eff88d6709544d96aaeb;p=firefly-linux-kernel-4.4.55.git UPSTREAM: net: arc_emac: reset txbd_curr and txbd_dirty pointers to zero EMAC reset internal tx ring pointer to zero at statup. txbd_curr and txbd_dirty can be different from zero. That cause ethernet transfer hang (no packets transmitted). In order to reproduce, run on device: ifconfig eth0 down ifconfig eth0 up Change-Id: Ie37cbd4761f8df216b2ddc5d07c0d6f036ac7092 Signed-off-by: Alexander Kochetkov Signed-off-by: David S. Miller Signed-off-by: Caesar Wang (cherry picked from git.kernel.org next/linux-next.git master commit 99f93a156a2aa9ac1e44f7cb1a197425e6d9879a) --- diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c index 63a63e31d59d..4f6e5be184df 100644 --- a/drivers/net/ethernet/arc/emac_main.c +++ b/drivers/net/ethernet/arc/emac_main.c @@ -447,6 +447,9 @@ static int arc_emac_open(struct net_device *ndev) *last_rx_bd = (*last_rx_bd + 1) % RX_BD_NUM; } + priv->txbd_curr = 0; + priv->txbd_dirty = 0; + /* Clean Tx BD's */ memset(priv->txbd, 0, TX_RING_SZ);