summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2021-08-05 14:21:56 +0300
committerLuca Coelho <luciano.coelho@intel.com>2021-08-26 23:36:10 +0300
commit78a19d5285d93e281b40c3b8d5a959fbbd2fe006 (patch)
treec0ab04107c5f8dc1f9782f9bf9bc8ca2eaf61c2e /drivers/net/wireless/intel/iwlwifi/mvm/fw.c
parentb537ffb6ea16b803b5ab5ef73c3bccc68a104af9 (diff)
iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage
We used to read the PPAG, WRDS, EWRD, WGDS tables from ACPI in the load stage only. This prevented vendor commands from being executed before bringing the interface up. Move reading those tables to INIT stage. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210805141826.ce3b60f0b426.I3643bf00e714aae930880cc7d6cf390b142eaccb@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/fw.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/fw.c105
1 files changed, 61 insertions, 44 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 0b769aac0b02..74404c96063b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -1058,16 +1058,7 @@ static const struct dmi_system_id dmi_ppag_approved_list[] = {
static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
{
- int ret;
-
- ret = iwl_mvm_get_ppag_table(mvm);
- if (ret < 0) {
- IWL_DEBUG_RADIO(mvm,
- "PPAG BIOS table invalid or unavailable. (%d)\n",
- ret);
- return 0;
- }
-
+ /* no need to read the table, done in INIT stage */
if (!dmi_check_system(dmi_ppag_approved_list)) {
IWL_DEBUG_RADIO(mvm,
"System vendor '%s' is not in the approved list, disabling PPAG.\n",
@@ -1192,12 +1183,65 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
ret);
}
}
+
+void iwl_mvm_get_acpi_tables(struct iwl_mvm *mvm)
+{
+ int ret;
+
+ /* read PPAG table */
+ ret = iwl_mvm_get_ppag_table(mvm);
+ if (ret < 0) {
+ IWL_DEBUG_RADIO(mvm,
+ "PPAG BIOS table invalid or unavailable. (%d)\n",
+ ret);
+ }
+
+ /* read SAR tables */
+ ret = iwl_sar_get_wrds_table(&mvm->fwrt);
+ if (ret < 0) {
+ IWL_DEBUG_RADIO(mvm,
+ "WRDS SAR BIOS table invalid or unavailable. (%d)\n",
+ ret);
+ /*
+ * If not available, don't fail and don't bother with EWRD and
+ * WGDS */
+
+ if (!iwl_sar_get_wgds_table(&mvm->fwrt)) {
+ /*
+ * If basic SAR is not available, we check for WGDS,
+ * which should *not* be available either. If it is
+ * available, issue an error, because we can't use SAR
+ * Geo without basic SAR.
+ */
+ IWL_ERR(mvm, "BIOS contains WGDS but no WRDS\n");
+ }
+
+ } else {
+ ret = iwl_sar_get_ewrd_table(&mvm->fwrt);
+ /* if EWRD is not available, we can still use
+ * WRDS, so don't fail */
+ if (ret < 0)
+ IWL_DEBUG_RADIO(mvm,
+ "EWRD SAR BIOS table invalid or unavailable. (%d)\n",
+ ret);
+
+ /* read geo SAR table */
+ if (iwl_sar_geo_support(&mvm->fwrt)) {
+ ret = iwl_sar_get_wgds_table(&mvm->fwrt);
+ if (ret < 0)
+ IWL_DEBUG_RADIO(mvm,
+ "Geo SAR BIOS table invalid or unavailable. (%d)\n",
+ ret);
+ /* we don't fail if the table is not available */
+ }
+ }
+}
#else /* CONFIG_ACPI */
inline int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm,
int prof_a, int prof_b)
{
- return -ENOENT;
+ return 1;
}
inline int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
@@ -1232,6 +1276,10 @@ static u8 iwl_mvm_eval_dsm_rfi(struct iwl_mvm *mvm)
{
return DSM_VALUE_RFI_DISABLE;
}
+
+void iwl_mvm_get_acpi_tables(struct iwl_mvm *mvm)
+{
+}
#endif /* CONFIG_ACPI */
void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
@@ -1287,27 +1335,6 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
static int iwl_mvm_sar_init(struct iwl_mvm *mvm)
{
- int ret;
-
- ret = iwl_sar_get_wrds_table(&mvm->fwrt);
- if (ret < 0) {
- IWL_DEBUG_RADIO(mvm,
- "WRDS SAR BIOS table invalid or unavailable. (%d)\n",
- ret);
- /*
- * If not available, don't fail and don't bother with EWRD.
- * Return 1 to tell that we can't use WGDS either.
- */
- return 1;
- }
-
- ret = iwl_sar_get_ewrd_table(&mvm->fwrt);
- /* if EWRD is not available, we can still use WRDS, so don't fail */
- if (ret < 0)
- IWL_DEBUG_RADIO(mvm,
- "EWRD SAR BIOS table invalid or unavailable. (%d)\n",
- ret);
-
return iwl_mvm_sar_select_profile(mvm, 1, 1);
}
@@ -1543,19 +1570,9 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
goto error;
ret = iwl_mvm_sar_init(mvm);
- if (ret == 0) {
+ if (ret == 0)
ret = iwl_mvm_sar_geo_init(mvm);
- } else if (ret == -ENOENT && !iwl_sar_get_wgds_table(&mvm->fwrt)) {
- /*
- * If basic SAR is not available, we check for WGDS,
- * which should *not* be available either. If it is
- * available, issue an error, because we can't use SAR
- * Geo without basic SAR.
- */
- IWL_ERR(mvm, "BIOS contains WGDS but no WRDS\n");
- }
-
- if (ret < 0)
+ else if (ret < 0)
goto error;
iwl_mvm_tas_init(mvm);