mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw89: acpi: check for _DSM function support before evaluating it
@ 2026-11-01 22:25 Rosen Penev
  2026-11-02  3:28 ` Ping-Ke Shih
  0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2026-11-01 22:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ping-Ke Shih, Zong-Zhe Yang, Kalle Valo, open list

When the WiFi device has no ACPI companion, or the firmware does not
implement a given rtw89 _DSM function, rtw89_acpi_evaluate_dsm() calls
acpi_evaluate_dsm() anyway. ACPI core then warns on every probe:

  ACPI: \: failed to evaluate _DSM e8c3a8d2-694b-004f-82bd-fe8607803aa7 rev:0 func:10 (0x1001)
  ACPI: \: failed to evaluate _DSM e8c3a8d2-694b-004f-82bd-fe8607803aa7 rev:0 func:6 (0x1001)

Here the handle is NULL, and acpi_evaluate_object() returns
AE_BAD_PARAMETER. All callers already treat failure as "no policy
provided by the platform", so this is only noise.

Use acpi_check_dsm() first. It returns false for a NULL handle and for
functions that are not advertised, so absent functions fail quietly at
debug level, as rtw89_acpi_evaluate_method() already does.

Seen on an RTL8852BE in a desktop PCIe slot.

Fixes: e897b0bef38a ("wifi: rtw89: introduce realtek ACPI DSM method")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/wireless/realtek/rtw89/acpi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/acpi.c b/drivers/net/wireless/realtek/rtw89/acpi.c
index ebb6cf555747..2968918936ac 100644
--- a/drivers/net/wireless/realtek/rtw89/acpi.c
+++ b/drivers/net/wireless/realtek/rtw89/acpi.c
@@ -372,11 +372,17 @@ int rtw89_acpi_evaluate_dsm(struct rtw89_dev *rtwdev,
 			    enum rtw89_acpi_dsm_func func,
 			    struct rtw89_acpi_dsm_result *res)
 {
+	acpi_handle handle = ACPI_HANDLE(rtwdev->dev);
 	union acpi_object *obj;
 	int ret;
 
-	obj = acpi_evaluate_dsm(ACPI_HANDLE(rtwdev->dev), &rtw89_guid,
-				0, func, NULL);
+	if (!acpi_check_dsm(handle, &rtw89_guid, 0, BIT(func))) {
+		rtw89_debug(rtwdev, RTW89_DBG_ACPI,
+			    "acpi dsm func %d not supported\n", func);
+		return -ENOENT;
+	}
+
+	obj = acpi_evaluate_dsm(handle, &rtw89_guid, 0, func, NULL);
 	if (!obj) {
 		rtw89_debug(rtwdev, RTW89_DBG_ACPI,
 			    "acpi dsm fail to evaluate func: %d\n", func);
-- 
2.56.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH rtw-next] wifi: rtw89: acpi: check for _DSM function support before evaluating it
  2026-11-01 22:25 [PATCH rtw-next] wifi: rtw89: acpi: check for _DSM function support before evaluating it Rosen Penev
@ 2026-11-02  3:28 ` Ping-Ke Shih
  2026-11-02  4:09   ` Rosen Penev
  0 siblings, 1 reply; 3+ messages in thread
From: Ping-Ke Shih @ 2026-11-02  3:28 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless; +Cc: Zong-Zhe Yang, Kalle Valo, open list

Rosen Penev <rosenp@gmail.com> wrote:
> When the WiFi device has no ACPI companion, or the firmware does not
> implement a given rtw89 _DSM function, rtw89_acpi_evaluate_dsm() calls
> acpi_evaluate_dsm() anyway. ACPI core then warns on every probe:
> 
>   ACPI: \: failed to evaluate _DSM e8c3a8d2-694b-004f-82bd-fe8607803aa7 rev:0 func:10 (0x1001)
>   ACPI: \: failed to evaluate _DSM e8c3a8d2-694b-004f-82bd-fe8607803aa7 rev:0 func:6 (0x1001)
> 
> Here the handle is NULL, and acpi_evaluate_object() returns
> AE_BAD_PARAMETER. All callers already treat failure as "no policy
> provided by the platform", so this is only noise.
> 
> Use acpi_check_dsm() first. It returns false for a NULL handle and for
> functions that are not advertised, so absent functions fail quietly at
> debug level, as rtw89_acpi_evaluate_method() already does.

The acpi_check_dsm() is to evaluate func 0 before actually accessing func. 
I'm not sure if all platforms will implement func 0. Do you know that?

> 
> Seen on an RTL8852BE in a desktop PCIe slot.
> 
> Fixes: e897b0bef38a ("wifi: rtw89: introduce realtek ACPI DSM method")

Does it need a Fixes? As I see, this is not a bug. 

> Signed-off-by: Rosen Penev <rosenp@gmail.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH rtw-next] wifi: rtw89: acpi: check for _DSM function support before evaluating it
  2026-11-02  3:28 ` Ping-Ke Shih
@ 2026-11-02  4:09   ` Rosen Penev
  0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2026-11-02  4:09 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: linux-wireless, Zong-Zhe Yang, Kalle Valo, open list

On Sun, Nov 1, 2026 at 7:28 PM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
> Rosen Penev <rosenp@gmail.com> wrote:
> > When the WiFi device has no ACPI companion, or the firmware does not
> > implement a given rtw89 _DSM function, rtw89_acpi_evaluate_dsm() calls
> > acpi_evaluate_dsm() anyway. ACPI core then warns on every probe:
> >
> >   ACPI: \: failed to evaluate _DSM e8c3a8d2-694b-004f-82bd-fe8607803aa7 rev:0 func:10 (0x1001)
> >   ACPI: \: failed to evaluate _DSM e8c3a8d2-694b-004f-82bd-fe8607803aa7 rev:0 func:6 (0x1001)
> >
> > Here the handle is NULL, and acpi_evaluate_object() returns
> > AE_BAD_PARAMETER. All callers already treat failure as "no policy
> > provided by the platform", so this is only noise.
> >
> > Use acpi_check_dsm() first. It returns false for a NULL handle and for
> > functions that are not advertised, so absent functions fail quietly at
> > debug level, as rtw89_acpi_evaluate_method() already does.
>
> The acpi_check_dsm() is to evaluate func 0 before actually accessing func.
> I'm not sure if all platforms will implement func 0. Do you know that?
yes this was only a partial fix. Will rework.
>
> >
> > Seen on an RTL8852BE in a desktop PCIe slot.
> >
> > Fixes: e897b0bef38a ("wifi: rtw89: introduce realtek ACPI DSM method")
>
> Does it need a Fixes? As I see, this is not a bug.
WIll drop.
>
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-02  4:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-01 22:25 [PATCH rtw-next] wifi: rtw89: acpi: check for _DSM function support before evaluating it Rosen Penev
2026-11-02  3:28 ` Ping-Ke Shih
2026-11-02  4:09   ` Rosen Penev

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®