ACPI fixes for 5.13-rc6

- Revert recent commit that attempted to fix the FACS table
    reference counting but introduced a problem with accessing
    the hardware signature after hibernation (Zhang Rui).
 
  - Fix regression in the _OSC handling that broke the loading
    of ACPI tables on some systems (Mika Westerberg).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmDDiooSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxmyEQAKnJvBIk8c0NL8MS6lTeNbitCc7SbOaP
 18KWd9nIaawCY6pWvhI334wO+/sUVt869+yG3Elh0zYlrpJPxHtfmRe4HtGRvFMh
 h3QZFfmbIgaoy+Rf3zq3zchWbxwjzbAeLG9qboMvaJxLw2WjnNphD0Yqz1nMwpgD
 Y919MNnIFFVz+XWD0JubdPqRKGeJu9spAILRafbr/FlrJSFV6HDe6KoNrLoEU8is
 ANEqiQfgM6e61gmN27O3IwDKiRMJkvkk+GFNYPLET8U4+hlvqsht+Wjhp6h+UycS
 Vr2M+X/FazgfveHrRj9VsCnHPHmjrRaGfOJqHhpFTspB3F6kSu84WdGLvEy4bAZH
 k74rwmN0KLPwnoOMOkjIkn5c9cPyZ3vdM4mnl3zUohoR8GPcBP+I+vgTtPIek0If
 //lMCMki6gAsMVlbelYIGOFeirEfnwHgQkym7a+ZkLcos4xvtE0xKyg8hf5QYpVj
 to9PQ8UQf4X/ppPom12ThCdmQwQOYzoRJQcHIv4W/1B3W0anfrJryvDecc1PnhxJ
 vnVdBKuTf8M6lI4r8qTYlyf2lkK0Lqb0g5OWwYfINDc1Tmez5FkCMZ7VGP608iHd
 Tp93/Sp8jXpVhwVxN6xwU78nRhJLF4bteZmv9i9Ti1uGdVSmYG+bwlLbA7/mIsq8
 RFnCUfhFrbPm
 =f8eH
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "These revert a problematic recent commit and fix a regression
  introduced during the 5.12 development cycle.

  Specifics:

   - Revert recent commit that attempted to fix the FACS table reference
     counting but introduced a problem with accessing the hardware
     signature after hibernation (Zhang Rui).

   - Fix regression in the _OSC handling that broke the loading of ACPI
     tables on some systems (Mika Westerberg)"

* tag 'acpi-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: Pass the same capabilities to the _OSC regardless of the query flag
  Revert "ACPI: sleep: Put the FACS table after using it"
This commit is contained in:
Linus Torvalds 2021-06-11 10:53:43 -07:00
commit d17bcc5ede
2 changed files with 10 additions and 23 deletions

View File

@ -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;
}
/*
* Now run _OSC again with query flag clear and with the caps
* supported by both the OS and the platform.
*/
capbuf[OSC_QUERY_DWORD] = 0;
capbuf[OSC_SUPPORT_DWORD] = capbuf_ret[OSC_SUPPORT_DWORD];
kfree(context.ret.pointer);
/* Now run _OSC again with query flag clear */
capbuf[OSC_QUERY_DWORD] = 0;
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);
}

View File

@ -1009,10 +1009,8 @@ static void acpi_sleep_hibernate_setup(void)
return;
acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs);
if (facs) {
if (facs)
s4_hardware_signature = facs->hardware_signature;
acpi_put_table((struct acpi_table_header *)facs);
}
}
#else /* !CONFIG_HIBERNATION */
static inline void acpi_sleep_hibernate_setup(void) {}