Commit d0c595a1 authored by Armin Wolf's avatar Armin Wolf Committed by Ilpo Järvinen

platform/x86: wmi: Use FW_BUG when warning about missing control methods

A missing WQxx control method is a firmware bug and should be
marked as such using FW_BUG so that users know that the issue
is not a kernel issue.
Since get_subobj_info() might fail even if the control method
is present, we need to print the warning only if acpi_get_handle()
fails.
Signed-off-by: default avatarArmin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240206220447.3102-2-W_Armin@gmx.deReviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 7f1b998a
...@@ -130,26 +130,6 @@ static const void *find_guid_context(struct wmi_block *wblock, ...@@ -130,26 +130,6 @@ static const void *find_guid_context(struct wmi_block *wblock,
return NULL; return NULL;
} }
static int get_subobj_info(acpi_handle handle, const char *pathname,
struct acpi_device_info **info)
{
acpi_handle subobj_handle;
acpi_status status;
status = acpi_get_handle(handle, pathname, &subobj_handle);
if (status == AE_NOT_FOUND)
return -ENOENT;
if (ACPI_FAILURE(status))
return -EIO;
status = acpi_get_object_info(subobj_handle, info);
if (ACPI_FAILURE(status))
return -EIO;
return 0;
}
static acpi_status wmi_method_enable(struct wmi_block *wblock, bool enable) static acpi_status wmi_method_enable(struct wmi_block *wblock, bool enable)
{ {
struct guid_block *block; struct guid_block *block;
...@@ -947,9 +927,10 @@ static int wmi_create_device(struct device *wmi_bus_dev, ...@@ -947,9 +927,10 @@ static int wmi_create_device(struct device *wmi_bus_dev,
struct wmi_block *wblock, struct wmi_block *wblock,
struct acpi_device *device) struct acpi_device *device)
{ {
struct acpi_device_info *info;
char method[WMI_ACPI_METHOD_NAME_SIZE]; char method[WMI_ACPI_METHOD_NAME_SIZE];
int result; struct acpi_device_info *info;
acpi_handle method_handle;
acpi_status status;
uint count; uint count;
if (wblock->gblock.flags & ACPI_WMI_EVENT) { if (wblock->gblock.flags & ACPI_WMI_EVENT) {
...@@ -977,15 +958,19 @@ static int wmi_create_device(struct device *wmi_bus_dev, ...@@ -977,15 +958,19 @@ static int wmi_create_device(struct device *wmi_bus_dev,
* we ignore this data block. * we ignore this data block.
*/ */
get_acpi_method_name(wblock, 'Q', method); get_acpi_method_name(wblock, 'Q', method);
result = get_subobj_info(device->handle, method, &info); status = acpi_get_handle(device->handle, method, &method_handle);
if (ACPI_FAILURE(status)) {
if (result) {
dev_warn(wmi_bus_dev, dev_warn(wmi_bus_dev,
"%s data block query control method not found\n", FW_BUG "%s data block query control method not found\n",
method); method);
return result;
return -ENXIO;
} }
status = acpi_get_object_info(method_handle, &info);
if (ACPI_FAILURE(status))
return -EIO;
wblock->dev.dev.type = &wmi_type_data; wblock->dev.dev.type = &wmi_type_data;
/* /*
......
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