Commit d5bd32a8 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'bnxt_en-bug-fixes'

Michael Chan says:

====================
bnxt_en: Bug fixes.

This first patch fixes a module eeprom A2h addressing issue.  The next
2 patches fix counter related issues.  The last one skips an
unsupported firmware call on the VF to avoid the error log.
====================

Link: https://lore.kernel.org/r/1605486472-28156-1-git-send-email-michael.chan@broadcom.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 064c9c32 0ae0a779
...@@ -4099,7 +4099,8 @@ static void bnxt_free_mem(struct bnxt *bp, bool irq_re_init) ...@@ -4099,7 +4099,8 @@ static void bnxt_free_mem(struct bnxt *bp, bool irq_re_init)
bnxt_free_ntp_fltrs(bp, irq_re_init); bnxt_free_ntp_fltrs(bp, irq_re_init);
if (irq_re_init) { if (irq_re_init) {
bnxt_free_ring_stats(bp); bnxt_free_ring_stats(bp);
if (!(bp->fw_cap & BNXT_FW_CAP_PORT_STATS_NO_RESET)) if (!(bp->fw_cap & BNXT_FW_CAP_PORT_STATS_NO_RESET) ||
test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
bnxt_free_port_stats(bp); bnxt_free_port_stats(bp);
bnxt_free_ring_grps(bp); bnxt_free_ring_grps(bp);
bnxt_free_vnics(bp); bnxt_free_vnics(bp);
...@@ -7757,6 +7758,7 @@ static void bnxt_add_one_ctr(u64 hw, u64 *sw, u64 mask) ...@@ -7757,6 +7758,7 @@ static void bnxt_add_one_ctr(u64 hw, u64 *sw, u64 mask)
{ {
u64 sw_tmp; u64 sw_tmp;
hw &= mask;
sw_tmp = (*sw & ~mask) | hw; sw_tmp = (*sw & ~mask) | hw;
if (hw < (*sw & mask)) if (hw < (*sw & mask))
sw_tmp += mask + 1; sw_tmp += mask + 1;
......
...@@ -2079,6 +2079,9 @@ int bnxt_hwrm_nvm_get_dev_info(struct bnxt *bp, ...@@ -2079,6 +2079,9 @@ int bnxt_hwrm_nvm_get_dev_info(struct bnxt *bp,
struct hwrm_nvm_get_dev_info_input req = {0}; struct hwrm_nvm_get_dev_info_input req = {0};
int rc; int rc;
if (BNXT_VF(bp))
return -EOPNOTSUPP;
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_GET_DEV_INFO, -1, -1); bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_GET_DEV_INFO, -1, -1);
mutex_lock(&bp->hwrm_cmd_lock); mutex_lock(&bp->hwrm_cmd_lock);
rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
...@@ -2997,7 +3000,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev, ...@@ -2997,7 +3000,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
/* Read A2 portion of the EEPROM */ /* Read A2 portion of the EEPROM */
if (length) { if (length) {
start -= ETH_MODULE_SFF_8436_LEN; start -= ETH_MODULE_SFF_8436_LEN;
rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 0,
start, length, data); start, length, data);
} }
return rc; return rc;
......
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