Skip to content

Commit ab124d5

Browse files
committed
Merge branch 'bnxt_en-2-bug-fixes'
Michael Chan says: ==================== bnxt_en: 2 bug fixes. This first patch fixes a rare but possible crash in pci_disable_msix() when the MTU is changed. The 2nd patch fixes a regression in error code handling when flashing a file to NVRAM. Please also queue these for -stable. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 249bc97 + 22630e2 commit ab124d5

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10982,13 +10982,13 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
1098210982
struct bnxt *bp = netdev_priv(dev);
1098310983

1098410984
if (netif_running(dev))
10985-
bnxt_close_nic(bp, false, false);
10985+
bnxt_close_nic(bp, true, false);
1098610986

1098710987
dev->mtu = new_mtu;
1098810988
bnxt_set_ring_params(bp);
1098910989

1099010990
if (netif_running(dev))
10991-
return bnxt_open_nic(bp, false, false);
10991+
return bnxt_open_nic(bp, true, false);
1099210992

1099310993
return 0;
1099410994
}

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,8 +2007,8 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
20072007
struct hwrm_nvm_install_update_output *resp = bp->hwrm_cmd_resp_addr;
20082008
struct hwrm_nvm_install_update_input install = {0};
20092009
const struct firmware *fw;
2010-
int rc, hwrm_err = 0;
20112010
u32 item_len;
2011+
int rc = 0;
20122012
u16 index;
20132013

20142014
bnxt_hwrm_fw_set_time(bp);
@@ -2052,15 +2052,14 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
20522052
memcpy(kmem, fw->data, fw->size);
20532053
modify.host_src_addr = cpu_to_le64(dma_handle);
20542054

2055-
hwrm_err = hwrm_send_message(bp, &modify,
2056-
sizeof(modify),
2057-
FLASH_PACKAGE_TIMEOUT);
2055+
rc = hwrm_send_message(bp, &modify, sizeof(modify),
2056+
FLASH_PACKAGE_TIMEOUT);
20582057
dma_free_coherent(&bp->pdev->dev, fw->size, kmem,
20592058
dma_handle);
20602059
}
20612060
}
20622061
release_firmware(fw);
2063-
if (rc || hwrm_err)
2062+
if (rc)
20642063
goto err_exit;
20652064

20662065
if ((install_type & 0xffff) == 0)
@@ -2069,20 +2068,19 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
20692068
install.install_type = cpu_to_le32(install_type);
20702069

20712070
mutex_lock(&bp->hwrm_cmd_lock);
2072-
hwrm_err = _hwrm_send_message(bp, &install, sizeof(install),
2073-
INSTALL_PACKAGE_TIMEOUT);
2074-
if (hwrm_err) {
2071+
rc = _hwrm_send_message(bp, &install, sizeof(install),
2072+
INSTALL_PACKAGE_TIMEOUT);
2073+
if (rc) {
20752074
u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err;
20762075

20772076
if (resp->error_code && error_code ==
20782077
NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
20792078
install.flags |= cpu_to_le16(
20802079
NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
2081-
hwrm_err = _hwrm_send_message(bp, &install,
2082-
sizeof(install),
2083-
INSTALL_PACKAGE_TIMEOUT);
2080+
rc = _hwrm_send_message(bp, &install, sizeof(install),
2081+
INSTALL_PACKAGE_TIMEOUT);
20842082
}
2085-
if (hwrm_err)
2083+
if (rc)
20862084
goto flash_pkg_exit;
20872085
}
20882086

@@ -2094,7 +2092,7 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
20942092
flash_pkg_exit:
20952093
mutex_unlock(&bp->hwrm_cmd_lock);
20962094
err_exit:
2097-
if (hwrm_err == -EACCES)
2095+
if (rc == -EACCES)
20982096
bnxt_print_admin_err(bp);
20992097
return rc;
21002098
}

0 commit comments

Comments
 (0)