netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] r8169: non-NAPI netif_poll_disable removal
@ 2004-11-02 18:03 Jon Mason
  2004-11-06 14:56 ` Francois Romieu
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Mason @ 2004-11-02 18:03 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

rtl8169_close contains a call to netif_poll_disable.  This call sets and spins 
on the __LINK_STATE_RX_SCHED bit, which isn't really a problem if this 
function is only called in close (as that bit is off with NAPI off).  
However, if the driver hits a transmit timeout (or any other call that 
references rtl8169_wait_for_quiescence), the the module will hang 
indefinitely during any subsequent call to netif_poll_disable or dev_close 
function call because this bit is now set.

Since this function should not really be called with NAPI off, I chose to 
remove the calls if NAPI is not defined (See patch below).  The patch is 
against the 2.6.10-rc1-mm2 version of the driver.  I have verified that this 
fixes the problem on ppc64 and x86_64.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>

--- r8169.c.orig        2004-11-02 10:21:31.305104272 -0600
+++ r8169.c     2004-11-02 10:25:56.849735352 -0600
@@ -85,10 +85,12 @@ VERSION 1.6LK       <2004/04/14>
 #define rtl8169_rx_skb                 netif_receive_skb
 #define rtl8169_rx_hwaccel_skb         vlan_hwaccel_rx
 #define rtl8169_rx_quota(count, quota) min(count, quota)
+#define rtl8169_poll_disable(dev)      netif_poll_disable(dev)
 #else
 #define rtl8169_rx_skb                 netif_rx
 #define rtl8169_rx_hwaccel_skb         vlan_hwaccel_receive_skb
 #define rtl8169_rx_quota(count, quota) count
+#define rtl8169_poll_disable(dev)
 #endif

 /* media options */
@@ -1745,7 +1747,7 @@ static void rtl8169_wait_for_quiescence(
        synchronize_irq(dev->irq);

        /* Wait for any pending NAPI task to complete */
-       netif_poll_disable(dev);
+       rtl8169_poll_disable(dev);
 }

 static void rtl8169_reinit_task(void *_data)
@@ -2284,7 +2286,7 @@ rtl8169_close(struct net_device *dev)

        free_irq(dev->irq, dev);

-       netif_poll_disable(dev);
+       rtl8169_poll_disable(dev);

        rtl8169_tx_clear(tp);

[-- Attachment #2: r8169-close-1.patch --]
[-- Type: text/x-diff, Size: 997 bytes --]

--- r8169.c.orig	2004-11-02 10:21:31.305104272 -0600
+++ r8169.c	2004-11-02 10:25:56.849735352 -0600
@@ -85,10 +85,12 @@ VERSION 1.6LK	<2004/04/14>
 #define rtl8169_rx_skb			netif_receive_skb
 #define rtl8169_rx_hwaccel_skb		vlan_hwaccel_rx
 #define rtl8169_rx_quota(count, quota)	min(count, quota)
+#define rtl8169_poll_disable(dev)	netif_poll_disable(dev)
 #else
 #define rtl8169_rx_skb			netif_rx
 #define rtl8169_rx_hwaccel_skb		vlan_hwaccel_receive_skb
 #define rtl8169_rx_quota(count, quota)	count
+#define rtl8169_poll_disable(dev)
 #endif
 
 /* media options */
@@ -1745,7 +1747,7 @@ static void rtl8169_wait_for_quiescence(
 	synchronize_irq(dev->irq);
 
 	/* Wait for any pending NAPI task to complete */
-	netif_poll_disable(dev);
+	rtl8169_poll_disable(dev);
 }
 
 static void rtl8169_reinit_task(void *_data)
@@ -2284,7 +2286,7 @@ rtl8169_close(struct net_device *dev)
 
 	free_irq(dev->irq, dev);
 
-	netif_poll_disable(dev);
+	rtl8169_poll_disable(dev);
 
 	rtl8169_tx_clear(tp);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-06 23:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-02 18:03 [PATCH 1/3] r8169: non-NAPI netif_poll_disable removal Jon Mason
2004-11-06 14:56 ` Francois Romieu
2004-11-06  9:30   ` Jon Mason
2004-11-06 23:38     ` Francois Romieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).