History

platform/x86: asus-wmi: Increase input buffer size of WMI methods

The asus-nb-wmi driver is matched by WMI alias but fails to load on TUF Gaming series laptops producing multiple ACPI errors in the kernel log. The input buffer for WMI method invocation size is 2 dwords, whereas 3 are expected by this model. FX505GM: .. Method (WMNB, 3, Serialized) { P8XH (Zero, 0x11) CreateDWordField (Arg2, Zero, IIA0) CreateDWordField (Arg2, 0x04, IIA1) CreateDWordField (Arg2, 0x08, IIA2) Local0 = (Arg1 & 0xFFFFFFFF) ... Compare with older K54C: ... Method (WMNB, 3, NotSerialized) { CreateDWordField (Arg2, 0x00, IIA0) CreateDWordField (Arg2, 0x04, IIA1) Local0 = (Arg1 & 0xFFFFFFFF) ... Increase buffer size to 3 dwords. No negative consequences of this change are expected, as the input buffer size is not verified. The original function is replaced by a wrapper for a new method passing value 0 for the last parameter. The new function will be used to control RGB keyboard backlight.

Yurii Pavlovskyi committed 7 years ago

Commit 98e865a1 parent 8853a2f1 file · +9 −1Browse files

Unified · Split

drivers/platform/x86/asus-wmi.c+9−1
@@ -98,6 +98,7 @@ static bool ashs_present(void) · 97 unmodified lines
9898 struct bios_args {
9999 u32 arg0;
100100 u32 arg1;
101+ u32 arg2; /* At least TUF Gaming series uses 3 dword input buffer. */
101102 } __packed;
102103
103104 /*
@@ -224,11 +225,13 @@ static void asus_wmi_input_exit(struct asus_wmi *asus) · 120 unmodified lines
224225 asus->inputdev = NULL;
225226 }
226227
227−int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval)
228+static int asus_wmi_evaluate_method3(u32 method_id,
229+ u32 arg0, u32 arg1, u32 arg2, u32 *retval)
228230 {
229231 struct bios_args args = {
230232 .arg0 = arg0,
231233 .arg1 = arg1,
234+ .arg2 = arg2,
232235 };
233236 struct acpi_buffer input = { (acpi_size) sizeof(args), &args };
234237 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -260,6 +263,11 @@ exit: · 25 unmodified lines
260263
261264 return 0;
262265 }
266+
267+int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval)
268+{
269+ return asus_wmi_evaluate_method3(method_id, arg0, arg1, 0, retval);
270+}
263271 EXPORT_SYMBOL_GPL(asus_wmi_evaluate_method);
264272
265273 static int asus_wmi_evaluate_method_agfn(const struct acpi_buffer args)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t