Skip to content

Commit

Permalink
amd8111e: don't call napi_enable if configured w/o NAPI
Browse files Browse the repository at this point in the history
The amd8111e network driver was broken by
bea3348, 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>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jiri Bohac authored and Jeff Garzik committed Nov 24, 2007
1 parent 77b6901 commit 3defd0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -1372,15 +1374,19 @@ 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);

amd8111e_init_hw_default(lp);

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;
Expand Down

0 comments on commit 3defd0e

Please sign in to comment.