Message ID | 20220225055224.190669-2-mario.limonciello@amd.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | [v2,1/3] ACPI: APEI: Adjust for acpi_run_osc logic changes | expand |
On Thu, Feb 24, 2022 at 11:52:23PM -0600, Mario Limonciello wrote: > Currently when capabilities have been masked by firmware during a > negotiation with OSC_QUERY_ENABLE set they're silently ignored > by the caller. If the caller calls `acpi_run_osc` again without > query set and the same capabilities, then they instead get a failure > possibly leading to downstream problems. > > So instead when query is set return AE_SUPPORT which callers can then > use for determining that capabilities were masked. > > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 07f604832fd6..f0f9e0934c10 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -243,16 +243,19 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) acpi_print_osc_error(handle, context, "_OSC invalid revision"); if (errors & OSC_CAPABILITIES_MASK_ERROR) { + acpi_print_osc_error(handle, context, "_OSC capabilities masked"); if (((u32 *)context->cap.pointer)[OSC_QUERY_DWORD] - & OSC_QUERY_ENABLE) - goto out_success; - status = AE_SUPPORT; - goto out_kfree; + & OSC_QUERY_ENABLE) { + status = AE_SUPPORT; + goto out_masked; + } } status = AE_ERROR; goto out_kfree; } -out_success: + + status = AE_OK; +out_masked: context->ret.length = out_obj->buffer.length; context->ret.pointer = kmemdup(out_obj->buffer.pointer, context->ret.length, GFP_KERNEL);
Currently when capabilities have been masked by firmware during a negotiation with OSC_QUERY_ENABLE set they're silently ignored by the caller. If the caller calls `acpi_run_osc` again without query set and the same capabilities, then they instead get a failure possibly leading to downstream problems. So instead when query is set return AE_SUPPORT which callers can then use for determining that capabilities were masked. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> --- drivers/acpi/bus.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)