From: Kalle Valo <kvalo@kernel.org>
To: David Wang <00107082@163.com>
Cc: miriam.rachel.korenblit@intel.com, johannes.berg@intel.com,
gregory.greenman@intel.com, pagadala.yesu.anjaneyulu@intel.com,
dan.carpenter@linaro.org, daniel.gabay@intel.com,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: iwlwifi: acpi/dsm: cache error retcode for iwl_acpi_get_dsm
Date: Tue, 27 Aug 2024 09:26:42 +0300 [thread overview]
Message-ID: <871q2afplp.fsf@kernel.org> (raw)
In-Reply-To: <20240827005114.4950-1-00107082@163.com> (David Wang's message of "Tue, 27 Aug 2024 08:51:14 +0800")
David Wang <00107082@163.com> writes:
> 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>
> ---
> drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
> index 79774c8c7ff4..3f98f522daac 100644
> --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
> +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
> @@ -30,6 +30,8 @@ static const size_t acpi_dsm_size[DSM_FUNC_NUM_FUNCS] = {
> [DSM_FUNC_ENABLE_11BE] = sizeof(u32),
> };
>
> +static int acpi_dsm_func_retcode[DSM_FUNC_NUM_FUNCS] = {0};
> +
> static int iwl_acpi_get_handle(struct device *dev, acpi_string method,
> acpi_handle *ret_handle)
> {
> @@ -169,6 +171,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 (acpi_dsm_func_retcode[func])
> + return acpi_dsm_func_retcode[func];
Static variables are usually avoided because they are problematic if
there are multiple iwlwifi devices on the same host. Should the error
message be just removed entirely?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2024-08-27 6:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 0:51 [PATCH] wifi: iwlwifi: acpi/dsm: cache error retcode for iwl_acpi_get_dsm David Wang
2024-08-27 6:26 ` Kalle Valo [this message]
2024-08-27 7:34 ` David Wang
2024-08-27 14:07 ` Ben Greear
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q2afplp.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=00107082@163.com \
--cc=dan.carpenter@linaro.org \
--cc=daniel.gabay@intel.com \
--cc=gregory.greenman@intel.com \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=pagadala.yesu.anjaneyulu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox