Skip to content

Commit dd2ebf3

Browse files
Vasundhara Volamdavem330
authored andcommitted
bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails
If FW returns FRAG_ERR in response error code, driver is resending the command only when HWRM command returns success. Fix the code to resend NVM_INSTALL_UPDATE command with DEFRAG install flags, if FW returns FRAG_ERR in its response error code. Fixes: cb4d1d6 ("bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag enabled.") Signed-off-by: Vasundhara Volam <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e8f267b commit dd2ebf3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,21 +2016,19 @@ static int bnxt_flash_package_from_file(struct net_device *dev,
20162016
mutex_lock(&bp->hwrm_cmd_lock);
20172017
hwrm_err = _hwrm_send_message(bp, &install, sizeof(install),
20182018
INSTALL_PACKAGE_TIMEOUT);
2019-
if (hwrm_err)
2020-
goto flash_pkg_exit;
2021-
2022-
if (resp->error_code) {
2019+
if (hwrm_err) {
20232020
u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err;
20242021

2025-
if (error_code == NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
2022+
if (resp->error_code && error_code ==
2023+
NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
20262024
install.flags |= cpu_to_le16(
20272025
NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
20282026
hwrm_err = _hwrm_send_message(bp, &install,
20292027
sizeof(install),
20302028
INSTALL_PACKAGE_TIMEOUT);
2031-
if (hwrm_err)
2032-
goto flash_pkg_exit;
20332029
}
2030+
if (hwrm_err)
2031+
goto flash_pkg_exit;
20342032
}
20352033

20362034
if (resp->result) {

0 commit comments

Comments
 (0)