Commit b5ff5ad1 authored by Deepak Sikri's avatar Deepak Sikri Committed by Ben Hutchings

stmmac: Fix for nfs hang on multiple reboot

commit 8e839891 upstream.

It was observed that during multiple reboots nfs hangs. The status of
receive descriptors shows that all the descriptors were in control of
CPU, and none were assigned to DMA.
Also the DMA status register confirmed that the Rx buffer is
unavailable.

This patch adds the fix for the same by adding the memory barriers to
ascertain that the all instructions before enabling the Rx or Tx DMA are
completed which involves the proper setting of the ownership bit in DMA
descriptors.
Signed-off-by: default avatarDeepak Sikri <deepak.sikri@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 91256cf4
...@@ -1174,6 +1174,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1174,6 +1174,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion);
wmb(); wmb();
priv->hw->desc->set_tx_owner(desc); priv->hw->desc->set_tx_owner(desc);
wmb();
} }
/* Interrupt on completition only for the latest segment */ /* Interrupt on completition only for the latest segment */
...@@ -1189,6 +1190,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1189,6 +1190,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
/* To avoid raise condition */ /* To avoid raise condition */
priv->hw->desc->set_tx_owner(first); priv->hw->desc->set_tx_owner(first);
wmb();
priv->cur_tx++; priv->cur_tx++;
...@@ -1252,6 +1254,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) ...@@ -1252,6 +1254,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv)
} }
wmb(); wmb();
priv->hw->desc->set_rx_owner(p + entry); priv->hw->desc->set_rx_owner(p + entry);
wmb();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment