Merge branch 'bnx2x-fixes'

Yuval Mintz says:

====================
bnx2x: small fixes

This adds 2 small fixes, one to error flows during memory release
and the other to flash writes via ethtool API.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2015-08-10 14:31:59 -07:00
commit 875a74b6d6
2 changed files with 17 additions and 1 deletions

View File

@ -262,9 +262,9 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
if (likely(skb)) {
(*pkts_compl)++;
(*bytes_compl) += skb->len;
dev_kfree_skb_any(skb);
}
dev_kfree_skb_any(skb);
tx_buf->first_bd = 0;
tx_buf->skb = NULL;

View File

@ -1718,6 +1718,22 @@ static int bnx2x_nvram_write(struct bnx2x *bp, u32 offset, u8 *data_buf,
offset += sizeof(u32);
data_buf += sizeof(u32);
written_so_far += sizeof(u32);
/* At end of each 4Kb page, release nvram lock to allow MFW
* chance to take it for its own use.
*/
if ((cmd_flags & MCPR_NVM_COMMAND_LAST) &&
(written_so_far < buf_size)) {
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
"Releasing NVM lock after offset 0x%x\n",
(u32)(offset - sizeof(u32)));
bnx2x_release_nvram_lock(bp);
usleep_range(1000, 2000);
rc = bnx2x_acquire_nvram_lock(bp);
if (rc)
return rc;
}
cmd_flags = 0;
}