Commit a5971d43 authored by Dmitry Kravkov's avatar Dmitry Kravkov Committed by David S. Miller

bnx2x: protect sequence increment with mutex

Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07bd8df5
...@@ -2222,12 +2222,13 @@ static void bnx2x_pmf_update(struct bnx2x *bp) ...@@ -2222,12 +2222,13 @@ static void bnx2x_pmf_update(struct bnx2x *bp)
u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param) u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param)
{ {
int mb_idx = BP_FW_MB_IDX(bp); int mb_idx = BP_FW_MB_IDX(bp);
u32 seq = ++bp->fw_seq; u32 seq;
u32 rc = 0; u32 rc = 0;
u32 cnt = 1; u32 cnt = 1;
u8 delay = CHIP_REV_IS_SLOW(bp) ? 100 : 10; u8 delay = CHIP_REV_IS_SLOW(bp) ? 100 : 10;
mutex_lock(&bp->fw_mb_mutex); mutex_lock(&bp->fw_mb_mutex);
seq = ++bp->fw_seq;
SHMEM_WR(bp, func_mb[mb_idx].drv_mb_param, param); SHMEM_WR(bp, func_mb[mb_idx].drv_mb_param, param);
SHMEM_WR(bp, func_mb[mb_idx].drv_mb_header, (command | seq)); SHMEM_WR(bp, func_mb[mb_idx].drv_mb_header, (command | seq));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment