Commit 60442dea authored by Shannon Nelson's avatar Shannon Nelson Committed by Jeff Kirsher

i40e: don't remove HMC that doesn't exist

If a reset recovery failed (e.g. firmware is broken), the HMC space won't
get set up.  We don't need to try to delete it if it didn't get set up.
This stops some needless error messages when we already know we need to
just tear things down.

Change-ID: Iac600481765e20b136052b43a544e55d7870268b
Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent cf05ed08
...@@ -5429,7 +5429,7 @@ static void i40e_fdir_teardown(struct i40e_pf *pf) ...@@ -5429,7 +5429,7 @@ static void i40e_fdir_teardown(struct i40e_pf *pf)
static int i40e_prep_for_reset(struct i40e_pf *pf) static int i40e_prep_for_reset(struct i40e_pf *pf)
{ {
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret; i40e_status ret = 0;
u32 v; u32 v;
clear_bit(__I40E_RESET_INTR_RECEIVED, &pf->state); clear_bit(__I40E_RESET_INTR_RECEIVED, &pf->state);
...@@ -5449,10 +5449,13 @@ static int i40e_prep_for_reset(struct i40e_pf *pf) ...@@ -5449,10 +5449,13 @@ static int i40e_prep_for_reset(struct i40e_pf *pf)
i40e_shutdown_adminq(&pf->hw); i40e_shutdown_adminq(&pf->hw);
/* call shutdown HMC */ /* call shutdown HMC */
ret = i40e_shutdown_lan_hmc(hw); if (hw->hmc.hmc_obj) {
if (ret) { ret = i40e_shutdown_lan_hmc(hw);
dev_info(&pf->pdev->dev, "shutdown_lan_hmc failed: %d\n", ret); if (ret) {
clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state); dev_warn(&pf->pdev->dev,
"shutdown_lan_hmc failed: %d\n", ret);
clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
}
} }
return ret; return ret;
} }
...@@ -8637,10 +8640,13 @@ static void i40e_remove(struct pci_dev *pdev) ...@@ -8637,10 +8640,13 @@ static void i40e_remove(struct pci_dev *pdev)
} }
/* shutdown and destroy the HMC */ /* shutdown and destroy the HMC */
ret_code = i40e_shutdown_lan_hmc(&pf->hw); if (pf->hw.hmc.hmc_obj) {
if (ret_code) ret_code = i40e_shutdown_lan_hmc(&pf->hw);
dev_warn(&pdev->dev, if (ret_code)
"Failed to destroy the HMC resources: %d\n", ret_code); dev_warn(&pdev->dev,
"Failed to destroy the HMC resources: %d\n",
ret_code);
}
/* shutdown the adminq */ /* shutdown the adminq */
ret_code = i40e_shutdown_adminq(&pf->hw); ret_code = i40e_shutdown_adminq(&pf->hw);
......
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