iwlwifi: pnvm: set the PNVM again if it was already loaded
When the interface goes up, we have already loaded the PNVM during
init, so we don't load it anymore. But we still need to set the PNVM
values in the context so that the FW can load it again.
Call set_pnvm when the PNVM is already loaded and change the
trans_pcie implementation to accept a second call to set_pnvm when we
have already allocated and, in this case, only set the values without
allocating again.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Fixes: 6972592850
("iwlwifi: read and parse PNVM file")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.622546a3566f.I659a8b9aa944d213c4ba446e142d74f3f6db9c64@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
parent
11dd729afa
commit
4a81598f0f
|
@ -227,6 +227,7 @@ int iwl_pnvm_load(struct iwl_trans *trans,
|
|||
struct iwl_notification_wait pnvm_wait;
|
||||
static const u16 ntf_cmds[] = { WIDE_ID(REGULATORY_AND_NVM_GROUP,
|
||||
PNVM_INIT_COMPLETE_NTFY) };
|
||||
int ret;
|
||||
|
||||
/* if the SKU_ID is empty, there's nothing to do */
|
||||
if (!trans->sku_id[0] && !trans->sku_id[1] && !trans->sku_id[2])
|
||||
|
@ -236,7 +237,6 @@ int iwl_pnvm_load(struct iwl_trans *trans,
|
|||
if (!trans->pnvm_loaded) {
|
||||
const struct firmware *pnvm;
|
||||
char pnvm_name[64];
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* The prefix unfortunately includes a hyphen at the end, so
|
||||
|
@ -264,6 +264,11 @@ int iwl_pnvm_load(struct iwl_trans *trans,
|
|||
|
||||
release_firmware(pnvm);
|
||||
}
|
||||
} else {
|
||||
/* if we already loaded, we need to set it again */
|
||||
ret = iwl_trans_set_pnvm(trans, NULL, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
iwl_init_notification_wait(notif_wait, &pnvm_wait,
|
||||
|
|
|
@ -298,16 +298,19 @@ int iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans,
|
|||
if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
|
||||
return 0;
|
||||
|
||||
ret = iwl_pcie_ctxt_info_alloc_dma(trans, data, len,
|
||||
&trans_pcie->pnvm_dram);
|
||||
if (ret < 0) {
|
||||
IWL_DEBUG_FW(trans, "Failed to allocate PNVM DMA %d.\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
/* only allocate the DRAM if not allocated yet */
|
||||
if (!trans->pnvm_loaded) {
|
||||
if (WARN_ON(prph_sc_ctrl->pnvm_cfg.pnvm_size))
|
||||
return -EBUSY;
|
||||
|
||||
if (WARN_ON(prph_sc_ctrl->pnvm_cfg.pnvm_size))
|
||||
return -EBUSY;
|
||||
ret = iwl_pcie_ctxt_info_alloc_dma(trans, data, len,
|
||||
&trans_pcie->pnvm_dram);
|
||||
if (ret < 0) {
|
||||
IWL_DEBUG_FW(trans, "Failed to allocate PNVM DMA %d.\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
prph_sc_ctrl->pnvm_cfg.pnvm_base_addr =
|
||||
cpu_to_le64(trans_pcie->pnvm_dram.physical);
|
||||
|
|
Loading…
Reference in New Issue