Skip to contentSkip to conversation

platform/x86: asus_wmi: Reserve more space for struct bias_args

PATCH In review Chris Chiu 2 participants 2 messages May 22, 2020

Subsystems (2)
lore
Share & tools
lore

Chris Chiu

author
#0 lore raw

PATCH 1/1 platform/x86: asus_wmi: Reserve more space for struct bias_args

On the ASUS laptop UX325JA/UX425JA, most of the media keys are not
working due to the ASUS WMI driver fails to be loaded. The ACPI error
as follows leads to the failure of asus_wmi_evaluate_method.
ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [IIA3] at bit offset/length 96/32 exceeds size of target Buffer (96 bits) (20200326/dsopcode-203) No Local Variables are initialized for Method [WMNB]
ACPI Error: Aborting method \_SB.ATKD.WMNB due to previous error (AE_AML_BUFFER_LIMIT) (20200326/psparse-531)

The DSDT for the WMNB part shows that 5 DWORD required for local variables and the 3rd variable IIA3 hit the buffer limit.

Method (WMNB, 3, Serialized)
{ ..

    CreateDWordField (Arg2, Zero, IIA0)
    CreateDWordField (Arg2, 0x04, IIA1)
    CreateDWordField (Arg2, 0x08, IIA2)
    CreateDWordField (Arg2, 0x0C, IIA3)
    CreateDWordField (Arg2, 0x10, IIA4)
    Local0 = (Arg1 & 0xFFFFFFFF)
    If ((Local0 == 0x54494E49))

..
}

The limitation is determined by the input acpi_buffer size passed to the wmi_evaluate_method. Since the struct bios_args is the data structure used as input buffer by default for all ASUS WMI calls, the size needs to be expanded to fix the problem.

---
 drivers/platform/x86/asus-wmi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/asus-wmi.c +2 -0
index bb7c529d7d16..cd212ee210e2 100644
@@ -116,6 +116,8 @@ struct bios_args {
 	u32 arg0;
 	u32 arg1;
 	u32 arg2; /* At least TUF Gaming series uses 3 dword input buffer. */
+	u32 arg4;
+	u32 arg5;
 } __packed;
 
 /*
Signature · 1 line
2.25.2
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 22 lines · Chris Chiu

On the ASUS laptop UX325JA/UX425JA, most of the media keys are not
working due to the ASUS WMI driver fails to be loaded. The ACPI error
as follows leads to the failure of asus_wmi_evaluate_method.
ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [IIA3] at bit offset/length 96/32 exceeds size of target Buffer (96 bits) (20200326/dsopcode-203) No Local Variables are initialized for Method [WMNB]
ACPI Error: Aborting method \_SB.ATKD.WMNB due to previous error (AE_AML_BUFFER_LIMIT) (20200326/psparse-531)

The DSDT for the WMNB part shows that 5 DWORD required for local variables and the 3rd variable IIA3 hit the buffer limit.

Method (WMNB, 3, Serialized)
{ ..

     CreateDWordField (Arg2, Zero, IIA0)
     CreateDWordField (Arg2, 0x04, IIA1)
     CreateDWordField (Arg2, 0x08, IIA2)
     CreateDWordField (Arg2, 0x0C, IIA3)
     CreateDWordField (Arg2, 0x10, IIA4)
     Local0 = (Arg1 & 0xFFFFFFFF)
     If ((Local0 == 0x54494E49))

..
}

Quoted 6 lines

The limitation is determined by the input acpi_buffer size passed to the wmi_evaluate_method. Since the struct bios_args is the data structure used as input buffer by default for all ASUS WMI calls, the size needs to be expanded to fix the problem.

Thank you, patch looks good to me:

Regards,

Hans

Quoted 18 lines
---
  drivers/platform/x86/asus-wmi.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/platform/x86/asus-wmi.c +2 -0
index bb7c529d7d16..cd212ee210e2 100644
@@ -116,6 +116,8 @@ struct bios_args {
  	u32 arg0;
  	u32 arg1;
  	u32 arg2; /* At least TUF Gaming series uses 3 dword input buffer. */
+	u32 arg4;
+	u32 arg5;
  } __packed;
 
  /*