aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-09-02 03:32:56 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-02 03:32:56 -0400
commit6cdee2f96a97f6da26bd3759c3f8823332fbb438 (patch)
treeec79086f05ffc3bdf1aecc37e108ccfc3a95450d /drivers/net/bnx2.c
parent0625491493d9000e4556bf566d205c28c8e7dc4e (diff)
parent2fbd3da3877ad8d923b055e5996f80b4d4a6daf4 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/yellowfin.c
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index fcaf3bc8277e..1357d548e698 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -401,9 +401,11 @@ static int bnx2_unregister_cnic(struct net_device *dev)
401 struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; 401 struct bnx2_napi *bnapi = &bp->bnx2_napi[0];
402 struct cnic_eth_dev *cp = &bp->cnic_eth_dev; 402 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
403 403
404 mutex_lock(&bp->cnic_lock);
404 cp->drv_state = 0; 405 cp->drv_state = 0;
405 bnapi->cnic_present = 0; 406 bnapi->cnic_present = 0;
406 rcu_assign_pointer(bp->cnic_ops, NULL); 407 rcu_assign_pointer(bp->cnic_ops, NULL);
408 mutex_unlock(&bp->cnic_lock);
407 synchronize_rcu(); 409 synchronize_rcu();
408 return 0; 410 return 0;
409} 411}
@@ -431,13 +433,13 @@ bnx2_cnic_stop(struct bnx2 *bp)
431 struct cnic_ops *c_ops; 433 struct cnic_ops *c_ops;
432 struct cnic_ctl_info info; 434 struct cnic_ctl_info info;
433 435
434 rcu_read_lock(); 436 mutex_lock(&bp->cnic_lock);
435 c_ops = rcu_dereference(bp->cnic_ops); 437 c_ops = bp->cnic_ops;
436 if (c_ops) { 438 if (c_ops) {
437 info.cmd = CNIC_CTL_STOP_CMD; 439 info.cmd = CNIC_CTL_STOP_CMD;
438 c_ops->cnic_ctl(bp->cnic_data, &info); 440 c_ops->cnic_ctl(bp->cnic_data, &info);
439 } 441 }
440 rcu_read_unlock(); 442 mutex_unlock(&bp->cnic_lock);
441} 443}
442 444
443static void 445static void
@@ -446,8 +448,8 @@ bnx2_cnic_start(struct bnx2 *bp)
446 struct cnic_ops *c_ops; 448 struct cnic_ops *c_ops;
447 struct cnic_ctl_info info; 449 struct cnic_ctl_info info;
448 450
449 rcu_read_lock(); 451 mutex_lock(&bp->cnic_lock);
450 c_ops = rcu_dereference(bp->cnic_ops); 452 c_ops = bp->cnic_ops;
451 if (c_ops) { 453 if (c_ops) {
452 if (!(bp->flags & BNX2_FLAG_USING_MSIX)) { 454 if (!(bp->flags & BNX2_FLAG_USING_MSIX)) {
453 struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; 455 struct bnx2_napi *bnapi = &bp->bnx2_napi[0];
@@ -457,7 +459,7 @@ bnx2_cnic_start(struct bnx2 *bp)
457 info.cmd = CNIC_CTL_START_CMD; 459 info.cmd = CNIC_CTL_START_CMD;
458 c_ops->cnic_ctl(bp->cnic_data, &info); 460 c_ops->cnic_ctl(bp->cnic_data, &info);
459 } 461 }
460 rcu_read_unlock(); 462 mutex_unlock(&bp->cnic_lock);
461} 463}
462 464
463#else 465#else
@@ -7687,6 +7689,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
7687 7689
7688 spin_lock_init(&bp->phy_lock); 7690 spin_lock_init(&bp->phy_lock);
7689 spin_lock_init(&bp->indirect_lock); 7691 spin_lock_init(&bp->indirect_lock);
7692#ifdef BCM_CNIC
7693 mutex_init(&bp->cnic_lock);
7694#endif
7690 INIT_WORK(&bp->reset_task, bnx2_reset_task); 7695 INIT_WORK(&bp->reset_task, bnx2_reset_task);
7691 7696
7692 dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); 7697 dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0);