platform/x86: asus-wmi: add debug print in more key places

Add more verbose debug print in the WMI method calls. This helps a lot
with debugging various issues working with regular users as the WMI
methods can be traced now.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20240910050507.685069-1-luke@ljones.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Luke D. Jones 2024-09-10 17:05:07 +12:00 committed by Hans de Goede
parent 5f1cda5110
commit f965e5bf65

View File

@ -354,20 +354,29 @@ static int asus_wmi_evaluate_method3(u32 method_id,
status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 0, method_id,
&input, &output);
if (ACPI_FAILURE(status))
pr_debug("%s called (0x%08x) with args: 0x%08x, 0x%08x, 0x%08x\n",
__func__, method_id, arg0, arg1, arg2);
if (ACPI_FAILURE(status)) {
pr_debug("%s, (0x%08x), arg 0x%08x failed: %d\n",
__func__, method_id, arg0, -EIO);
return -EIO;
}
obj = (union acpi_object *)output.pointer;
if (obj && obj->type == ACPI_TYPE_INTEGER)
tmp = (u32) obj->integer.value;
pr_debug("Result: 0x%08x\n", tmp);
if (retval)
*retval = tmp;
kfree(obj);
if (tmp == ASUS_WMI_UNSUPPORTED_METHOD)
if (tmp == ASUS_WMI_UNSUPPORTED_METHOD) {
pr_debug("%s, (0x%08x), arg 0x%08x failed: %d\n",
__func__, method_id, arg0, -ENODEV);
return -ENODEV;
}
return 0;
}
@ -397,20 +406,29 @@ static int asus_wmi_evaluate_method5(u32 method_id,
status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 0, method_id,
&input, &output);
if (ACPI_FAILURE(status))
pr_debug("%s called (0x%08x) with args: 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x\n",
__func__, method_id, arg0, arg1, arg2, arg3, arg4);
if (ACPI_FAILURE(status)) {
pr_debug("%s, (0x%08x), arg 0x%08x failed: %d\n",
__func__, method_id, arg0, -EIO);
return -EIO;
}
obj = (union acpi_object *)output.pointer;
if (obj && obj->type == ACPI_TYPE_INTEGER)
tmp = (u32) obj->integer.value;
pr_debug("Result: %x\n", tmp);
if (retval)
*retval = tmp;
kfree(obj);
if (tmp == ASUS_WMI_UNSUPPORTED_METHOD)
if (tmp == ASUS_WMI_UNSUPPORTED_METHOD) {
pr_debug("%s, (0x%08x), arg 0x%08x failed: %d\n",
__func__, method_id, arg0, -ENODEV);
return -ENODEV;
}
return 0;
}
@ -436,8 +454,13 @@ static int asus_wmi_evaluate_method_buf(u32 method_id,
status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 0, method_id,
&input, &output);
if (ACPI_FAILURE(status))
pr_debug("%s called (0x%08x) with args: 0x%08x, 0x%08x\n",
__func__, method_id, arg0, arg1);
if (ACPI_FAILURE(status)) {
pr_debug("%s, (0x%08x), arg 0x%08x failed: %d\n",
__func__, method_id, arg0, -EIO);
return -EIO;
}
obj = (union acpi_object *)output.pointer;
@ -473,8 +496,11 @@ static int asus_wmi_evaluate_method_buf(u32 method_id,
kfree(obj);
if (err)
if (err) {
pr_debug("%s, (0x%08x), arg 0x%08x failed: %d\n",
__func__, method_id, arg0, err);
return err;
}
return 0;
}
@ -562,6 +588,7 @@ static bool asus_wmi_dev_is_present(struct asus_wmi *asus, u32 dev_id)
{
u32 retval;
int status = asus_wmi_get_devstate(asus, dev_id, &retval);
pr_debug("%s called (0x%08x), retval: 0x%08x\n", __func__, dev_id, retval);
return status == 0 && (retval & ASUS_WMI_DSTS_PRESENCE_BIT);
}
@ -3617,18 +3644,27 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus)
err = fan_curve_check_present(asus, &asus->cpu_fan_curve_available,
ASUS_WMI_DEVID_CPU_FAN_CURVE);
if (err)
if (err) {
pr_debug("%s, checked 0x%08x, failed: %d\n",
__func__, ASUS_WMI_DEVID_CPU_FAN_CURVE, err);
return err;
}
err = fan_curve_check_present(asus, &asus->gpu_fan_curve_available,
ASUS_WMI_DEVID_GPU_FAN_CURVE);
if (err)
if (err) {
pr_debug("%s, checked 0x%08x, failed: %d\n",
__func__, ASUS_WMI_DEVID_GPU_FAN_CURVE, err);
return err;
}
err = fan_curve_check_present(asus, &asus->mid_fan_curve_available,
ASUS_WMI_DEVID_MID_FAN_CURVE);
if (err)
if (err) {
pr_debug("%s, checked 0x%08x, failed: %d\n",
__func__, ASUS_WMI_DEVID_MID_FAN_CURVE, err);
return err;
}
if (!asus->cpu_fan_curve_available
&& !asus->gpu_fan_curve_available
@ -4459,8 +4495,10 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
else if (attr == &dev_attr_available_mini_led_mode.attr)
ok = asus->mini_led_dev_id != 0;
if (devid != -1)
if (devid != -1) {
ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0);
pr_debug("%s called 0x%08x, ok: %x\n", __func__, devid, ok);
}
return ok ? attr->mode : 0;
}