Re: [PATCH v2.1 6/8] ACPI: bus: Rework the handling of \_SB._OSC platform features

From: Jonathan Cameron

Date: Tue Dec 23 2025 - 06:25:17 EST


On Mon, 22 Dec 2025 20:21:19 +0100
"Rafael J. Wysocki" <rafael@xxxxxxxxxx> wrote:

> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> Both acpi_bus_osc_negotiate_platform_control() and
> acpi_bus_osc_negotiate_usb_control() first call acpi_run_osc() to
> evaluate _OSC in "query mode", with OSC_QUERY_ENABLE set in the
> capabilities buffer, and then use the resultant feature mask as
> the input buffer for requesting control of those features by
> calling acpi_run_osc() to evaluate _OSC with OSC_QUERY_ENABLE clear.
>
> This involves some code duplication and unnecessary memory
> allocations, so introduce a new helper function carrying out an
> _OSC handshake along the lines of the above description in a simpler
> way and update acpi_bus_osc_negotiate_platform_control() to use it.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>