Skip to contentSkip to conversation

wifi: rtw89: acpi: skip _DSM when there is no ACPI companion

PATCH In review Rosen Penev 2 participants 2 messages Nov 17 Realtek wireless driver (rtw89)

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 wifi: rtw89: acpi: skip _DSM when there is no ACPI companion

When the WiFi device has no ACPI companion, ACPI_HANDLE(rtwdev->dev) is NULL and rtw89_acpi_evaluate_dsm() still calls acpi_evaluate_dsm(). acpi_evaluate_object() then returns AE_BAD_PARAMETER and ACPI core 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)

All callers already treat failure as "no policy provided by the platform", so this is only noise. Bail out early in that case.

Seen on an RTL8852BE in a desktop PCIe slot.

---
v4: add Acked-by. Remove stale commit wording.
v3: remove acpi_check_dsm()
v2: check handle separately. Remove Fixes.

 drivers/net/wireless/realtek/rtw89/acpi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw89/acpi.c +7 -2
index ebb6cf555747..d8cf8eb2527b 100644
@@ -372,11 +372,16 @@ 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 (!handle) {
+		rtw89_debug(rtwdev, RTW89_DBG_ACPI, "acpi dsm no handle\n");
+		return -ENODEV;
+	}
+
+	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);
Signature · 1 line
2.56.1
maintainer
#1 lore raw
Quoted 8 lines · Rosen Penev

When the WiFi device has no ACPI companion, ACPI_HANDLE(rtwdev->dev) is NULL and rtw89_acpi_evaluate_dsm() still calls acpi_evaluate_dsm(). acpi_evaluate_object() then returns AE_BAD_PARAMETER and ACPI core 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)

Quoted 7 lines

All callers already treat failure as "no policy provided by the platform", so this is only noise. Bail out early in that case.

Seen on an RTL8852BE in a desktop PCIe slot.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

badf4c3c7679 wifi: rtw89: acpi: skip _DSM when there is no ACPI companion

---
https://github.com/pkshih/rtw.git