net: fec: clear receive interrupts before processing a packet
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 8 Jul 2014 12:01:49 +0000 (13:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jul 2014 03:57:46 +0000 (20:57 -0700)
Clear any pending receive interrupt before we process a pending packet.
This helps to avoid any spurious interrupts being raised after we have
fully cleaned the receive ring, while still allowing an interrupt to be
raised if we receive another packet.

The position of this is critical: we must do this prior to reading the
next packet status to avoid potentially dropping an interrupt when a
packet is still pending.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index b2ae7e706d5e359e232086a0c81bdb545ca753b5..79d578d6db8a408682a509666a84a42f36fcaf46 100644 (file)
@@ -1184,6 +1184,8 @@ fec_enet_rx(struct net_device *ndev, int budget)
                if ((status & BD_ENET_RX_LAST) == 0)
                        netdev_err(ndev, "rcv is not +last\n");
 
+               writel(FEC_ENET_RXF, fep->hwp + FEC_IEVENT);
+
                /* Check for errors. */
                if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
                           BD_ENET_RX_CR | BD_ENET_RX_OV)) {