]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
r8169: fix infinite loop during hotplug
authorArnaud Patard <apatard@mandriva.com>
Sun, 17 Dec 2006 21:12:09 +0000 (22:12 +0100)
committerAdrian Bunk <bunk@stusta.de>
Sun, 17 Dec 2006 21:12:09 +0000 (22:12 +0100)
Bug reported for PCMCIA.

Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/net/r8169.c

index 68e009bfbdda3b954e402eebd86639675688f64e..9841acd8bdcc65d2e30b2f6a8a5135a709770afb 100644 (file)
@@ -2619,6 +2619,7 @@ static void rtl8169_down(struct net_device *dev)
        struct rtl8169_private *tp = netdev_priv(dev);
        void __iomem *ioaddr = tp->mmio_addr;
        unsigned int poll_locked = 0;
+       unsigned int intrmask;
 
        rtl8169_delete_timer(dev);
 
@@ -2657,8 +2658,11 @@ core_down:
         * 2) dev->change_mtu
         *    -> rtl8169_poll can not be issued again and re-enable the
         *       interruptions. Let's simply issue the IRQ down sequence again.
+        *
+        * No loop if hotpluged or major error (0xffff).
         */
-       if (RTL_R16(IntrMask))
+       intrmask = RTL_R16(IntrMask);
+       if (intrmask && (intrmask != 0xffff))
                goto core_down;
 
        rtl8169_tx_clear(tp);