]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: CPPC: Do not prevent CPPC from working in the future
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 21 Jul 2022 17:41:10 +0000 (19:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:15 +0000 (11:18 +0200)
commitaf3b9e0619cd33ff87db6ff209f8c0df3ec45eb1
tree1084c8f288a6dc2a317b9e5daed3b59b380fd054
parent0e069d56a310beafe8ba5fad261b004bd69c737a
ACPI: CPPC: Do not prevent CPPC from working in the future

commit 6a6eac6568f4ec7f37f217c39d8686fd4d053db6 upstream.

There is a problem with the current revision checks in
is_cppc_supported() that they essentially prevent the CPPC support
from working if a new _CPC package format revision being a proper
superset of the v3 and only causing _CPC to return a package with more
entries (while retaining the types and meaning of the entries defined by
the v3) is introduced in the future and used by the platform firmware.

In that case, as long as the number of entries in the _CPC return
package is at least CPPC_V3_NUM_ENT, it should be perfectly fine to
use the v3 support code and disregard the additional package entries
added by the new package format revision.

For this reason, drop is_cppc_supported() altogether, put the revision
checks directly into acpi_cppc_processor_probe() so they are easier to
follow and rework them to take the case mentioned above into account.

Fixes: 0ba5a50084d3 ("ACPI / CPPC: Add support for CPPC v3")
Cc: 4.18+ <stable@vger.kernel.org> # 4.18+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/cppc_acpi.c
include/acpi/cppc_acpi.h