netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amd8111e: don't call napi_enable if configured w/o NAPI
@ 2007-11-21 12:40 Jiri Bohac
  2007-11-24  3:09 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Bohac @ 2007-11-21 12:40 UTC (permalink / raw)
  To: jgarzik; +Cc: Stephen Hemminger, David S. Miller, netdev

The amd8111e network driver was broken by 
bea3348eef27e6044b6161fd04c3152215f96411, which makes the driver
call napi_enable() and napi_disable() even if the driver had been 
configured without CONFIG_AMD8111E_NAPI, and thus
netif_napi_add() had not been called on initialization.
This triggers a BUG in napi_enable().

This patch fixes the problem. Please apply.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>


diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index eebf5bb..e7fdd81 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -1340,7 +1340,9 @@ static int amd8111e_close(struct net_device * dev)
 	struct amd8111e_priv *lp = netdev_priv(dev);
 	netif_stop_queue(dev);
 
+#ifdef CONFIG_AMD8111E_NAPI
 	napi_disable(&lp->napi);
+#endif
 
 	spin_lock_irq(&lp->lock);
 
@@ -1372,7 +1374,9 @@ static int amd8111e_open(struct net_device * dev )
 					 dev->name, dev))
 		return -EAGAIN;
 
+#ifdef CONFIG_AMD8111E_NAPI
 	napi_enable(&lp->napi);
+#endif
 
 	spin_lock_irq(&lp->lock);
 
@@ -1380,7 +1384,9 @@ static int amd8111e_open(struct net_device * dev )
 
 	if(amd8111e_restart(dev)){
 		spin_unlock_irq(&lp->lock);
+#ifdef CONFIG_AMD8111E_NAPI
 		napi_disable(&lp->napi);
+#endif
 		if (dev->irq)
 			free_irq(dev->irq, dev);
 		return -ENOMEM;




-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


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

end of thread, other threads:[~2007-11-24  3:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-21 12:40 [PATCH] amd8111e: don't call napi_enable if configured w/o NAPI Jiri Bohac
2007-11-24  3:09 ` Jeff Garzik

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).