From: Punnaiah Choudary Kalluri Date: Wed, 29 Apr 2015 03:04:46 +0000 (+0530) Subject: net: macb: Fix race condition in driver when Rx frame is dropped X-Git-Tag: v4.1-rc2~6^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d4c216c54197d741ed8b7ca54f13645dfb3eacde;p=karo-tx-linux.git net: macb: Fix race condition in driver when Rx frame is dropped Under heavy Rx load, observed that the Hw is updating the USED bit and it is not updating the received frame status to the BD control field. This could be lack of resources for processing the BDs at high data rates. Driver drops the frame associated with this BD but not clearing the USED bit. So, this is causing hang condition as Hw expects USED bit to be cleared for this BD. Signed-off-by: Punnaiah Choudary Kalluri Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 665c29098e3c..4104d49f005d 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -707,6 +707,9 @@ static void gem_rx_refill(struct macb *bp) /* properly align Ethernet header */ skb_reserve(skb, NET_IP_ALIGN); + } else { + bp->rx_ring[entry].addr &= ~MACB_BIT(RX_USED); + bp->rx_ring[entry].ctrl = 0; } }