Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170709
b: refs/heads/master
c: c4ff7cb
h: refs/heads/master
i:
  170707: 7c11d18
v: v3
  • Loading branch information
Eilon Greenstein authored and David S. Miller committed Oct 15, 2009
1 parent 1bb388b commit 09e6a58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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: f34d28ea0174df63253dc20a95de0b48e3d8145a
refs/heads/master: c4ff7cbf88be8bb0e3f942089f0ef0a40d98d654
3 changes: 3 additions & 0 deletions trunk/drivers/net/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,9 @@ struct bnx2x {
/* used to synchronize dmae accesses */
struct mutex dmae_mutex;

/* used to protect the FW mail box */
struct mutex fw_mb_mutex;

/* used to synchronize stats collecting */
int stats_state;
/* used by dmae command loader */
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2528,6 +2528,7 @@ u32 bnx2x_fw_command(struct bnx2x *bp, u32 command)
u32 cnt = 1;
u8 delay = CHIP_REV_IS_SLOW(bp) ? 100 : 10;

mutex_lock(&bp->fw_mb_mutex);
SHMEM_WR(bp, func_mb[func].drv_mb_header, (command | seq));
DP(BNX2X_MSG_MCP, "wrote command (%x) to FW MB\n", (command | seq));

Expand All @@ -2537,8 +2538,8 @@ u32 bnx2x_fw_command(struct bnx2x *bp, u32 command)

rc = SHMEM_RD(bp, func_mb[func].fw_mb_header);

/* Give the FW up to 2 second (200*10ms) */
} while ((seq != (rc & FW_MSG_SEQ_NUMBER_MASK)) && (cnt++ < 200));
/* Give the FW up to 5 second (500*10ms) */
} while ((seq != (rc & FW_MSG_SEQ_NUMBER_MASK)) && (cnt++ < 500));

DP(BNX2X_MSG_MCP, "[after %d ms] read (%x) seq is (%x) from FW MB\n",
cnt*delay, rc, seq);
Expand All @@ -2552,6 +2553,7 @@ u32 bnx2x_fw_command(struct bnx2x *bp, u32 command)
bnx2x_fw_dump(bp);
rc = 0;
}
mutex_unlock(&bp->fw_mb_mutex);

return rc;
}
Expand Down Expand Up @@ -8956,6 +8958,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
smp_wmb(); /* Ensure that bp->intr_sem update is SMP-safe */

mutex_init(&bp->port.phy_mutex);
mutex_init(&bp->fw_mb_mutex);
#ifdef BCM_CNIC
mutex_init(&bp->cnic_mutex);
#endif
Expand Down

0 comments on commit 09e6a58

Please sign in to comment.