Skip to content

Commit

Permalink
Merge branch 'acpi-bus'
Browse files Browse the repository at this point in the history
* acpi-bus:
  ACPI: Pass the same capabilities to the _OSC regardless of the query flag
  • Loading branch information
rafaeljw committed Jun 11, 2021
2 parents f1ffa9d + 159d8c2 commit bc8865a
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,32 +330,21 @@ static void acpi_bus_osc_negotiate_platform_control(void)
if (ACPI_FAILURE(acpi_run_osc(handle, &context)))
return;

capbuf_ret = context.ret.pointer;
if (context.ret.length <= OSC_SUPPORT_DWORD) {
kfree(context.ret.pointer);
return;
}
kfree(context.ret.pointer);

/*
* Now run _OSC again with query flag clear and with the caps
* supported by both the OS and the platform.
*/
/* Now run _OSC again with query flag clear */
capbuf[OSC_QUERY_DWORD] = 0;
capbuf[OSC_SUPPORT_DWORD] = capbuf_ret[OSC_SUPPORT_DWORD];
kfree(context.ret.pointer);

if (ACPI_FAILURE(acpi_run_osc(handle, &context)))
return;

capbuf_ret = context.ret.pointer;
if (context.ret.length > OSC_SUPPORT_DWORD) {
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_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;

kfree(context.ret.pointer);
}
Expand Down

0 comments on commit bc8865a

Please sign in to comment.