Commit 7eccb5ed authored by Mario Limonciello's avatar Mario Limonciello Committed by Andy Shevchenko

platform/x86: intel-wmi-thunderbolt: Add dynamic debugging

Some users have been reporting issues with thunderbolt being turned off
before fully initialized. This is suspected to be caused by userspace
turning off the Thunderbolt controller using intel-wmi-thunderbolt
prematurely.

Userspace has already made some mitigations for this situation:
https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66
https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384

To allow easier debugging of this situation add output that can be turned
on with dynamic debugging to better root cause this problem.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199631
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=201227Suggested-by: default avatarMika Westerberg <mika.westerberg@intel.com>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@dell.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent a8694eeb
......@@ -30,12 +30,16 @@ static ssize_t force_power_store(struct device *dev,
input.length = sizeof(u8);
input.pointer = &mode;
mode = hex_to_bin(buf[0]);
dev_dbg(dev, "force_power: storing %#x\n", mode);
if (mode == 0 || mode == 1) {
status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
&input, NULL);
if (ACPI_FAILURE(status))
if (ACPI_FAILURE(status)) {
dev_dbg(dev, "force_power: failed to evaluate ACPI method\n");
return -ENODEV;
}
} else {
dev_dbg(dev, "force_power: unsupported mode\n");
return -EINVAL;
}
return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment