diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-07-21 01:47:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-21 14:18:29 -0400 |
commit | e15107065d073714dc47cf6b80c8bf5eea1bf18b (patch) | |
tree | 72bd606ad044b29cf127029b645e5823b978f6a7 /drivers/net | |
parent | 37dbbf32a0d45f0ed88f92cb6d0c35f4809e3a8e (diff) |
bnx2x: SMP-safe inter_sem
Signed-off-by: Vlad Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2x_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index f20df6d7dcb5..18c380330bed 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -706,6 +706,8 @@ static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw) | |||
706 | 706 | ||
707 | /* disable interrupt handling */ | 707 | /* disable interrupt handling */ |
708 | atomic_inc(&bp->intr_sem); | 708 | atomic_inc(&bp->intr_sem); |
709 | smp_wmb(); /* Ensure that bp->intr_sem update is SMP-safe */ | ||
710 | |||
709 | if (disable_hw) | 711 | if (disable_hw) |
710 | /* prevent the HW from sending interrupts */ | 712 | /* prevent the HW from sending interrupts */ |
711 | bnx2x_int_disable(bp); | 713 | bnx2x_int_disable(bp); |
@@ -6642,7 +6644,12 @@ static void bnx2x_napi_disable(struct bnx2x *bp) | |||
6642 | 6644 | ||
6643 | static void bnx2x_netif_start(struct bnx2x *bp) | 6645 | static void bnx2x_netif_start(struct bnx2x *bp) |
6644 | { | 6646 | { |
6645 | if (atomic_dec_and_test(&bp->intr_sem)) { | 6647 | int intr_sem; |
6648 | |||
6649 | intr_sem = atomic_dec_and_test(&bp->intr_sem); | ||
6650 | smp_wmb(); /* Ensure that bp->intr_sem update is SMP-safe */ | ||
6651 | |||
6652 | if (intr_sem) { | ||
6646 | if (netif_running(bp->dev)) { | 6653 | if (netif_running(bp->dev)) { |
6647 | bnx2x_napi_enable(bp); | 6654 | bnx2x_napi_enable(bp); |
6648 | bnx2x_int_enable(bp); | 6655 | bnx2x_int_enable(bp); |
@@ -8229,6 +8236,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
8229 | 8236 | ||
8230 | /* Disable interrupt handling until HW is initialized */ | 8237 | /* Disable interrupt handling until HW is initialized */ |
8231 | atomic_set(&bp->intr_sem, 1); | 8238 | atomic_set(&bp->intr_sem, 1); |
8239 | smp_wmb(); /* Ensure that bp->intr_sem update is SMP-safe */ | ||
8232 | 8240 | ||
8233 | mutex_init(&bp->port.phy_mutex); | 8241 | mutex_init(&bp->port.phy_mutex); |
8234 | 8242 | ||