]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: bus: Rework the handling of \_SB._OSC platform features
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Dec 2025 19:21:19 +0000 (20:21 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 23 Dec 2025 16:12:00 +0000 (17:12 +0100)
commite5322888e6bf4ec17964a93638c9b14433a2f6f1
tree8b349a07f6630d3354c9086404151383102cf006
parent5ada805104d4fd89504206216f297c112382bfd1
ACPI: bus: Rework the handling of \_SB._OSC platform features

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@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/1966378.CQOukoFCf9@rafael.j.wysocki
drivers/acpi/bus.c