* [PATCH v2] wifi: iwlwifi: acpi/dsm: cache error retcode for iwl_acpi_get_dsm
@ 2024-08-27 8:43 David Wang
0 siblings, 0 replies; only message in thread
From: David Wang @ 2024-08-27 8:43 UTC (permalink / raw)
To: miriam.rachel.korenblit, kvalo, johannes.berg,
pagadala.yesu.anjaneyulu, dan.carpenter, daniel.gabay
Cc: linux-wireless, linux-kernel, David Wang
On some HW, acpi _DSM query would failed for iwlwifi device
and everytime when network is reactiaved (boot,
suspend/resume, manually restart network, etc.),
bunch of kernel warning shows up together:
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
ACPI: \: failed to evaluate _DSM bf0212f2-788f-c64d-a5b3-1f738e285ade (0x1001)
since iwlwifi would make 8 acpi/dsm queries for lari config.
But for iwlwifi, it is safe to cache the _DSM errors,
since it is not possible to correct it without upgrading BIOS.
With this patch, those kernel warnings would only show up once when
booting the system and unnecessary acpi/dsm queries are avoid.
Signed-off-by: David Wang <00107082@163.com>
---
Change since v1:
- make acpi_dsm_func_retcode cache per device.
---
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 6 ++++++
drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index 79774c8c7ff4..22dfce6d5111 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -169,6 +169,10 @@ int iwl_acpi_get_dsm(struct iwl_fw_runtime *fwrt,
if (WARN_ON(func >= ARRAY_SIZE(acpi_dsm_size)))
return -EINVAL;
+ /* If HW return an error once, do not bother try again. */
+ if (fwrt && fwrt->acpi_dsm_func_retcode[func])
+ return fwrt->acpi_dsm_func_retcode[func];
+
expected_size = acpi_dsm_size[func];
/* Currently all ACPI DSMs are either 8-bit or 32-bit */
@@ -177,6 +181,8 @@ int iwl_acpi_get_dsm(struct iwl_fw_runtime *fwrt,
ret = iwl_acpi_get_dsm_integer(fwrt->dev, ACPI_DSM_REV, func,
&iwl_guid, &tmp, expected_size);
+ if (fwrt)
+ fwrt->acpi_dsm_func_retcode[func] = ret;
if (ret)
return ret;
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
index 048877fa7c71..63dca94a937c 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
@@ -182,6 +182,8 @@ struct iwl_fw_runtime {
bool sgom_enabled;
struct iwl_mcc_allowed_ap_type_cmd uats_table;
u8 uefi_tables_lock_status;
+ int acpi_dsm_func_retcode[DSM_FUNC_NUM_FUNCS];
+
};
void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,
--
2.39.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-08-27 8:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-27 8:43 [PATCH v2] wifi: iwlwifi: acpi/dsm: cache error retcode for iwl_acpi_get_dsm David Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®