Merge branch 'acpica'

Merge ACPICA changes for 6.3-rc1:

 - Drop port I/O validation for some regions to avoid AML failures due
   to rejections of legitimate port I/O writes (Mario Limonciello).

 - Constify acpi_get_handle() pathname argument to allow its callers to
   pass conts pathnames to it (Sakari Ailus).

 - Prevent acpi_ns_simple_repair() from crashing in some cases when
   AE_AML_NO_RETURN_VALUE should be returned (Daniil Tatianin).

 - Fix typo in CDAT DSMAS struct definition (Lukas Wunner).

* acpica:
  ACPICA: Fix typo in CDAT DSMAS struct definition
  ACPICA: nsrepair: handle cases without a return value correctly
  ACPICA: Constify pathname argument for acpi_get_handle()
  ACPICA: Drop port I/O validation for some regions
This commit is contained in:
Rafael J. Wysocki 2023-02-15 15:14:19 +01:00
commit 391712d753
5 changed files with 14 additions and 11 deletions

View file

@ -23,8 +23,8 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width);
*
* The table is used to implement the Microsoft port access rules that
* first appeared in Windows XP. Some ports are always illegal, and some
* ports are only illegal if the BIOS calls _OSI with a win_XP string or
* later (meaning that the BIOS itelf is post-XP.)
* ports are only illegal if the BIOS calls _OSI with nothing newer than
* the specific _OSI strings.
*
* This provides ACPICA with the desired port protections and
* Microsoft compatibility.
@ -145,7 +145,8 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
/* Port illegality may depend on the _OSI calls made by the BIOS */
if (acpi_gbl_osi_data >= port_info->osi_dependency) {
if (port_info->osi_dependency == ACPI_ALWAYS_ILLEGAL ||
acpi_gbl_osi_data == port_info->osi_dependency) {
ACPI_DEBUG_PRINT((ACPI_DB_VALUES,
"Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)\n",
ACPI_FORMAT_UINT64(address),

View file

@ -181,8 +181,9 @@ acpi_ns_simple_repair(struct acpi_evaluate_info *info,
* Try to fix if there was no return object. Warning if failed to fix.
*/
if (!return_object) {
if (expected_btypes && (!(expected_btypes & ACPI_RTYPE_NONE))) {
if (package_index != ACPI_NOT_PACKAGE_ELEMENT) {
if (expected_btypes) {
if (!(expected_btypes & ACPI_RTYPE_NONE) &&
package_index != ACPI_NOT_PACKAGE_ELEMENT) {
ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
ACPI_WARN_ALWAYS,
@ -196,14 +197,15 @@ acpi_ns_simple_repair(struct acpi_evaluate_info *info,
if (ACPI_SUCCESS(status)) {
return (AE_OK); /* Repair was successful */
}
} else {
}
if (expected_btypes != ACPI_RTYPE_NONE) {
ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
ACPI_WARN_ALWAYS,
"Missing expected return value"));
return (AE_AML_NO_RETURN_VALUE);
}
return (AE_AML_NO_RETURN_VALUE);
}
}

View file

@ -44,7 +44,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
acpi_status
acpi_get_handle(acpi_handle parent,
acpi_string pathname, acpi_handle *ret_handle)
const char *pathname, acpi_handle *ret_handle)
{
acpi_status status;
struct acpi_namespace_node *node = NULL;

View file

@ -526,7 +526,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
struct acpi_buffer *ret_path_ptr))
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_get_handle(acpi_handle parent,
acpi_string pathname,
const char *pathname,
acpi_handle *ret_handle))
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_attach_data(acpi_handle object,

View file

@ -344,7 +344,7 @@ enum acpi_cdat_type {
/* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */
struct acpi_cadt_dsmas {
struct acpi_cdat_dsmas {
u8 dsmad_handle;
u8 flags;
u16 reserved;