Skip to contentSkip to conversation

platform/x86: dell-dw5826e: fix ACPI _DSM function index and bitmask usage

PATCH Superseded [email protected] 2 participants 2 messages Jul 22 – Jul 24 x86 platform drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: dell-dw5826e: fix ACPI _DSM function index and bitmask usage

From: surendra <[email protected]>

PALC_DSM_FN_TRIGGER_PLDR was defined as BIT(1) (value 2).

acpi_evaluate_dsm() expects a 0-based function index integer (0, 1, 2, ...), whereas acpi_check_dsm() expects a bitmask of supported function indices (BIT(1), BIT(2), ...).

Because PALC_DSM_FN_TRIGGER_PLDR was defined as BIT(1), acpi_evaluate_dsm() was evaluating Function Index 2 instead of Function Index 1, while acpi_check_dsm() was checking for Function Index 1 support.

Fix this by setting PALC_DSM_FN_TRIGGER_PLDR to 1 (the function index) and passing BIT(PALC_DSM_FN_TRIGGER_PLDR) to acpi_check_dsm().

Fixes 1ab843135a77 ("platform/x86: dell-dw5826e: Add reset driver for DW5826e")
---
 drivers/platform/x86/dell/dell-dw5826e-reset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/dell/dell-dw5826e-reset.c +2 -2
index 1ca7c3421bb5..64e6e9b1d7a0 100644
@@ -13,7 +13,7 @@
 #include <linux/types.h>
 #include <linux/uuid.h>
 
-#define PALC_DSM_FN_TRIGGER_PLDR    BIT(1)
+#define PALC_DSM_FN_TRIGGER_PLDR    1
 
 static guid_t palc_dsm_guid =
 	GUID_INIT(0x5a1a4bba, 0x8006, 0x487e, 0xbe, 0x0a, 0xac, 0xf5, 0xd8, 0xfd, 0xfe, 0x59);
@@ -66,7 +66,7 @@ static int palc_probe(struct platform_device *pdev)
 	if (!handle)
 		return -ENODEV;
 
-	if (!acpi_check_dsm(handle, &palc_dsm_guid, 1, PALC_DSM_FN_TRIGGER_PLDR))
+	if (!acpi_check_dsm(handle, &palc_dsm_guid, 1, BIT(PALC_DSM_FN_TRIGGER_PLDR)))
 		return -ENODEV;
 
 	return 0;
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 13 lines · On Wed, 22 Jul 2026, [email protected] wrote:

From: surendra <[email protected]>

PALC_DSM_FN_TRIGGER_PLDR was defined as BIT(1) (value 2).

acpi_evaluate_dsm() expects a 0-based function index integer (0, 1, 2, ...), whereas acpi_check_dsm() expects a bitmask of supported function indices (BIT(1), BIT(2), ...).

Because PALC_DSM_FN_TRIGGER_PLDR was defined as BIT(1), acpi_evaluate_dsm() was evaluating Function Index 2 instead of Function Index 1, while acpi_check_dsm() was checking for Function Index 1 support.

Quoted 5 lines

Fix this by setting PALC_DSM_FN_TRIGGER_PLDR to 1 (the function index) and passing BIT(PALC_DSM_FN_TRIGGER_PLDR) to acpi_check_dsm().

Fixes 1ab843135a77 ("platform/x86: dell-dw5826e: Add reset driver for DW5826e")

Hi,

Thanks for the fix. We, however, need your real/full name on the Signed-off-by line (and From should usually match that as well) to be allowed to apply the patch.

For more information, please see:
Documentation/process/submitting-patches.rst

--
i.

Quoted 27 lines
---
 drivers/platform/x86/dell/dell-dw5826e-reset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/dell/dell-dw5826e-reset.c +2 -2
index 1ca7c3421bb5..64e6e9b1d7a0 100644
@@ -13,7 +13,7 @@
 #include <linux/types.h>
 #include <linux/uuid.h>
 
-#define PALC_DSM_FN_TRIGGER_PLDR    BIT(1)
+#define PALC_DSM_FN_TRIGGER_PLDR    1
 
 static guid_t palc_dsm_guid =
 	GUID_INIT(0x5a1a4bba, 0x8006, 0x487e, 0xbe, 0x0a, 0xac, 0xf5, 0xd8, 0xfd, 0xfe, 0x59);
@@ -66,7 +66,7 @@ static int palc_probe(struct platform_device *pdev)
 	if (!handle)
 		return -ENODEV;
 
-	if (!acpi_check_dsm(handle, &palc_dsm_guid, 1, PALC_DSM_FN_TRIGGER_PLDR))
+	if (!acpi_check_dsm(handle, &palc_dsm_guid, 1, BIT(PALC_DSM_FN_TRIGGER_PLDR)))
 		return -ENODEV;
 
 	return 0;