Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6420
b: refs/heads/master
c: afdc08b
h: refs/heads/master
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Aug 29, 2005
1 parent 4ce0ebb commit 5e0fc6e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2373ce1ca04dd46bf2b8b0f9a799eb2a90da92fb
refs/heads/master: afdc08b9f9a7174d7912a160f657f39d46379b5e
15 changes: 14 additions & 1 deletion trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3975,12 +3975,17 @@ bnx2_reset_task(void *data)
{
struct bnx2 *bp = data;

if (!netif_running(bp->dev))
return;

bp->in_reset_task = 1;
bnx2_netif_stop(bp);

bnx2_init_nic(bp);

atomic_set(&bp->intr_sem, 1);
bnx2_netif_start(bp);
bp->in_reset_task = 0;
}

static void
Expand Down Expand Up @@ -4172,7 +4177,13 @@ bnx2_close(struct net_device *dev)
struct bnx2 *bp = dev->priv;
u32 reset_code;

flush_scheduled_work();
/* Calling flush_scheduled_work() may deadlock because
* linkwatch_event() may be on the workqueue and it will try to get
* the rtnl_lock which we are holding.
*/
while (bp->in_reset_task)
msleep(1);

bnx2_netif_stop(bp);
del_timer_sync(&bp->timer);
if (bp->wol)
Expand Down Expand Up @@ -5453,6 +5464,8 @@ bnx2_remove_one(struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata(pdev);
struct bnx2 *bp = dev->priv;

flush_scheduled_work();

unregister_netdev(dev);

if (bp->regview)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3874,6 +3874,7 @@ struct bnx2 {
int timer_interval;
struct timer_list timer;
struct work_struct reset_task;
int in_reset_task;

/* Used to synchronize phy accesses. */
spinlock_t phy_lock;
Expand Down

0 comments on commit 5e0fc6e

Please sign in to comment.