r8169: use RxFIFO overflow workaround for 8168c chipset.
authorIvan Vecera <ivecera@redhat.com>
Thu, 27 Jan 2011 11:24:11 +0000 (12:24 +0100)
committerFrancois Romieu <romieu@fr.zoreil.com>
Fri, 4 Feb 2011 09:38:06 +0000 (10:38 +0100)
I found that one of the 8168c chipsets (concretely XID 1c4000c0) starts
generating RxFIFO overflow errors. The result is an infinite loop in
interrupt handler as the RxFIFOOver is handled only for ...MAC_VER_11.
With the workaround everything goes fine.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes <hayeswang@realtek.com>
drivers/net/r8169.c

index bde7d61f193063b91ffb7fb02c0a1db787ca7d78..9ab3b43c7d040f14c28f4ad0edc7e9997e9d0a8b 100644 (file)
@@ -3757,7 +3757,8 @@ static void rtl_hw_start_8168(struct net_device *dev)
        RTL_W16(IntrMitigate, 0x5151);
 
        /* Work around for RxFIFO overflow. */
-       if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
+       if (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
+           tp->mac_version == RTL_GIGA_MAC_VER_22) {
                tp->intr_event |= RxFIFOOver | PCSTimeout;
                tp->intr_event &= ~RxOverflow;
        }
@@ -4641,7 +4642,8 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 
                /* Work around for rx fifo overflow */
                if (unlikely(status & RxFIFOOver) &&
-               (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
+                   (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
+                    tp->mac_version == RTL_GIGA_MAC_VER_22)) {
                        netif_stop_queue(dev);
                        rtl8169_tx_timeout(dev);
                        break;