From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Remove checks that have become redundant after a previous change from
acpi_bus_osc_negotiate_platform_control(), add a debug statement
regarding the negotiated support bit mask to it and add an empty
code line to it for more clarity.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/bus.c | 28 +++++++++++-----------------
1 file changed, 11 insertions(+), 17 deletions(-)
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -319,7 +319,7 @@ bool osc_sb_cppc2_support_acked;
static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
static void acpi_bus_osc_negotiate_platform_control(void)
{
- u32 capbuf[2], *capbuf_ret;
+ u32 capbuf[2], *capbuf_ret, ret_support;
struct acpi_osc_context context = {
.uuid_str = sb_uuid_str,
.rev = 1,
@@ -371,6 +371,7 @@ static void acpi_bus_osc_negotiate_platf
if (!ghes_disable)
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT;
+
if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
return;
@@ -378,10 +379,9 @@ static void acpi_bus_osc_negotiate_platf
return;
capbuf_ret = context.ret.pointer;
- if (context.ret.length <= OSC_SUPPORT_DWORD) {
- kfree(context.ret.pointer);
- return;
- }
+
+ acpi_handle_debug(handle, "Negotiated _OSC mask [%04x]\n",
+ capbuf_ret[OSC_SUPPORT_DWORD]);
/*
* Now run _OSC again with query flag clear and with the caps
@@ -395,20 +395,14 @@ static void acpi_bus_osc_negotiate_platf
return;
capbuf_ret = context.ret.pointer;
- if (context.ret.length > OSC_SUPPORT_DWORD) {
+ ret_support = capbuf_ret[OSC_SUPPORT_DWORD];
#ifdef CONFIG_ACPI_CPPC_LIB
- osc_sb_cppc2_support_acked = capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CPCV2_SUPPORT;
+ osc_sb_cppc2_support_acked = ret_support & OSC_SB_CPCV2_SUPPORT;
#endif
-
- osc_sb_apei_support_acked =
- capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
- osc_pc_lpi_support_confirmed =
- capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_PCLPI_SUPPORT;
- osc_sb_native_usb4_support_confirmed =
- capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_NATIVE_USB4_SUPPORT;
- osc_cpc_flexible_adr_space_confirmed =
- capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CPC_FLEXIBLE_ADR_SPACE;
- }
+ osc_sb_apei_support_acked = ret_support & OSC_SB_APEI_SUPPORT;
+ osc_pc_lpi_support_confirmed = ret_support & OSC_SB_PCLPI_SUPPORT;
+ osc_sb_native_usb4_support_confirmed = ret_support & OSC_SB_NATIVE_USB4_SUPPORT;
+ osc_cpc_flexible_adr_space_confirmed = ret_support & OSC_SB_CPC_FLEXIBLE_ADR_SPACE;
kfree(context.ret.pointer);
}