diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2011-05-25 00:55:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-25 17:55:32 -0400 |
commit | a5971d43ef76f4b73c58e2d893de9db487388c87 (patch) | |
tree | 93d92dbc2faf62d52f841b197124085693c33d34 | |
parent | 07bd8df5df4369487812bf85a237322ff3569b77 (diff) |
bnx2x: protect sequence increment with mutex
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index a97d9be331d1..4b70311a11ef 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -2222,12 +2222,13 @@ static void bnx2x_pmf_update(struct bnx2x *bp) | |||
2222 | u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param) | 2222 | u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param) |
2223 | { | 2223 | { |
2224 | int mb_idx = BP_FW_MB_IDX(bp); | 2224 | int mb_idx = BP_FW_MB_IDX(bp); |
2225 | u32 seq = ++bp->fw_seq; | 2225 | u32 seq; |
2226 | u32 rc = 0; | 2226 | u32 rc = 0; |
2227 | u32 cnt = 1; | 2227 | u32 cnt = 1; |
2228 | u8 delay = CHIP_REV_IS_SLOW(bp) ? 100 : 10; | 2228 | u8 delay = CHIP_REV_IS_SLOW(bp) ? 100 : 10; |
2229 | 2229 | ||
2230 | mutex_lock(&bp->fw_mb_mutex); | 2230 | mutex_lock(&bp->fw_mb_mutex); |
2231 | seq = ++bp->fw_seq; | ||
2231 | SHMEM_WR(bp, func_mb[mb_idx].drv_mb_param, param); | 2232 | SHMEM_WR(bp, func_mb[mb_idx].drv_mb_param, param); |
2232 | SHMEM_WR(bp, func_mb[mb_idx].drv_mb_header, (command | seq)); | 2233 | SHMEM_WR(bp, func_mb[mb_idx].drv_mb_header, (command | seq)); |
2233 | 2234 | ||