Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157015
b: refs/heads/master
c: 08fdef9
h: refs/heads/master
i:
  157013: 6ee3757
  157011: 748fd8f
  157007: 76fd4ca
v: v3
  • Loading branch information
David S. Miller committed Aug 18, 2009
1 parent 9871690 commit 31ce380
Show file tree
Hide file tree
Showing 21 changed files with 175 additions and 89 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: 518ff04fd84290a7ad9042e8a46d78d29cb443d3
refs/heads/master: 08fdef99342955a62884fb5c49ab43431a1cafbf
17 changes: 11 additions & 6 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,11 @@ static int bnx2_unregister_cnic(struct net_device *dev)
struct bnx2_napi *bnapi = &bp->bnx2_napi[0];
struct cnic_eth_dev *cp = &bp->cnic_eth_dev;

mutex_lock(&bp->cnic_lock);
cp->drv_state = 0;
bnapi->cnic_present = 0;
rcu_assign_pointer(bp->cnic_ops, NULL);
mutex_unlock(&bp->cnic_lock);
synchronize_rcu();
return 0;
}
Expand Down Expand Up @@ -429,13 +431,13 @@ bnx2_cnic_stop(struct bnx2 *bp)
struct cnic_ops *c_ops;
struct cnic_ctl_info info;

rcu_read_lock();
c_ops = rcu_dereference(bp->cnic_ops);
mutex_lock(&bp->cnic_lock);
c_ops = bp->cnic_ops;
if (c_ops) {
info.cmd = CNIC_CTL_STOP_CMD;
c_ops->cnic_ctl(bp->cnic_data, &info);
}
rcu_read_unlock();
mutex_unlock(&bp->cnic_lock);
}

static void
Expand All @@ -444,8 +446,8 @@ bnx2_cnic_start(struct bnx2 *bp)
struct cnic_ops *c_ops;
struct cnic_ctl_info info;

rcu_read_lock();
c_ops = rcu_dereference(bp->cnic_ops);
mutex_lock(&bp->cnic_lock);
c_ops = bp->cnic_ops;
if (c_ops) {
if (!(bp->flags & BNX2_FLAG_USING_MSIX)) {
struct bnx2_napi *bnapi = &bp->bnx2_napi[0];
Expand All @@ -455,7 +457,7 @@ bnx2_cnic_start(struct bnx2 *bp)
info.cmd = CNIC_CTL_START_CMD;
c_ops->cnic_ctl(bp->cnic_data, &info);
}
rcu_read_unlock();
mutex_unlock(&bp->cnic_lock);
}

#else
Expand Down Expand Up @@ -7663,6 +7665,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)

spin_lock_init(&bp->phy_lock);
spin_lock_init(&bp->indirect_lock);
#ifdef BCM_CNIC
mutex_init(&bp->cnic_lock);
#endif
INIT_WORK(&bp->reset_task, bnx2_reset_task);

dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0);
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 @@ -6902,6 +6902,7 @@ struct bnx2 {
u32 idle_chk_status_idx;

#ifdef BCM_CNIC
struct mutex cnic_lock;
struct cnic_eth_dev cnic_eth_dev;
#endif

Expand Down
Loading

0 comments on commit 31ce380

Please sign in to comment.