aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sungem.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-11-29 05:51:36 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-11-29 05:51:36 -0500
commitdde655c9df02ee07ed090dfdb7ae8741bf299e14 (patch)
tree9880b957e04e587507910be222e7dc5da7a1e9a5 /drivers/net/sungem.c
parent5dba4797115c8fa05c1a4d12927a6ae0b33ffc41 (diff)
[SUNGEM]: Fix NAPI regression with reset work
sungem's gem_reset_task() will unconditionally try to disable NAPI even when it's called while the interface is not operating and hence the NAPI struct isn't enabled. Make napi_disable() depend on gp->running. Also removes a superfluous test of gp->running in the same function. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/net/sungem.c')
-rw-r--r--drivers/net/sungem.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index f6fedcc32de1..68872142530b 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2281,14 +2281,12 @@ static void gem_reset_task(struct work_struct *work)
2281 2281
2282 mutex_lock(&gp->pm_mutex); 2282 mutex_lock(&gp->pm_mutex);
2283 2283
2284 napi_disable(&gp->napi); 2284 if (gp->opened)
2285 napi_disable(&gp->napi);
2285 2286
2286 spin_lock_irq(&gp->lock); 2287 spin_lock_irq(&gp->lock);
2287 spin_lock(&gp->tx_lock); 2288 spin_lock(&gp->tx_lock);
2288 2289
2289 if (gp->running == 0)
2290 goto not_running;
2291
2292 if (gp->running) { 2290 if (gp->running) {
2293 netif_stop_queue(gp->dev); 2291 netif_stop_queue(gp->dev);
2294 2292
@@ -2298,13 +2296,14 @@ static void gem_reset_task(struct work_struct *work)
2298 gem_set_link_modes(gp); 2296 gem_set_link_modes(gp);
2299 netif_wake_queue(gp->dev); 2297 netif_wake_queue(gp->dev);
2300 } 2298 }
2301 not_running: 2299
2302 gp->reset_task_pending = 0; 2300 gp->reset_task_pending = 0;
2303 2301
2304 spin_unlock(&gp->tx_lock); 2302 spin_unlock(&gp->tx_lock);
2305 spin_unlock_irq(&gp->lock); 2303 spin_unlock_irq(&gp->lock);
2306 2304
2307 napi_enable(&gp->napi); 2305 if (gp->opened)
2306 napi_enable(&gp->napi);
2308 2307
2309 mutex_unlock(&gp->pm_mutex); 2308 mutex_unlock(&gp->pm_mutex);
2310} 2309}