Commit 9b259f1e authored by Vasundhara Volam's avatar Vasundhara Volam Committed by Greg Kroah-Hartman

bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails

[ Upstream commit dd2ebf34 ]

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: cb4d1d62 ("bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag enabled.")
Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c636fdf4
...@@ -1778,22 +1778,20 @@ static int bnxt_flash_package_from_file(struct net_device *dev, ...@@ -1778,22 +1778,20 @@ static int bnxt_flash_package_from_file(struct net_device *dev,
mutex_lock(&bp->hwrm_cmd_lock); mutex_lock(&bp->hwrm_cmd_lock);
hwrm_err = _hwrm_send_message(bp, &install, sizeof(install), hwrm_err = _hwrm_send_message(bp, &install, sizeof(install),
INSTALL_PACKAGE_TIMEOUT); INSTALL_PACKAGE_TIMEOUT);
if (hwrm_err) if (hwrm_err) {
goto flash_pkg_exit;
if (resp->error_code) {
u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err; u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err;
if (error_code == NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) { if (resp->error_code && error_code ==
NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
install.flags |= cpu_to_le16( install.flags |= cpu_to_le16(
NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG); NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
hwrm_err = _hwrm_send_message(bp, &install, hwrm_err = _hwrm_send_message(bp, &install,
sizeof(install), sizeof(install),
INSTALL_PACKAGE_TIMEOUT); INSTALL_PACKAGE_TIMEOUT);
}
if (hwrm_err) if (hwrm_err)
goto flash_pkg_exit; goto flash_pkg_exit;
} }
}
if (resp->result) { if (resp->result) {
netdev_err(dev, "PKG install error = %d, problem_item = %d\n", netdev_err(dev, "PKG install error = %d, problem_item = %d\n",
......
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