Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d6e9cfa authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

ACPICA: Fix for Device/Thermal objects with ObjectType and DerefOf

ACPICA commit 89565151aa4db7b546d4935b187bf2c4a86885ee

These types must be special cased because the namespace node
does not contain a subobject as do all other types.

Link: https://github.com/acpica/acpica/commit/89565151


Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c6915b3f
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -921,13 +921,26 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
			 * This is a deref_of (object_reference)
			 * Get the actual object from the Node (This is the dereference).
			 * This case may only happen when a local_x or arg_x is
			 * dereferenced above.
			 * dereferenced above, or for references to device and
			 * thermal objects.
			 */
			return_desc = acpi_ns_get_attached_object((struct
								   acpi_namespace_node
								   *)
								  operand[0]);
			switch (((struct acpi_namespace_node *)operand[0])->
				type) {
			case ACPI_TYPE_DEVICE:
			case ACPI_TYPE_THERMAL:

				/* These types have no node subobject, return the NS node */

				return_desc = operand[0];
				break;

			default:
				/* For most types, get the object attached to the node */

				return_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)operand[0]);
				acpi_ut_add_reference(return_desc);
				break;
			}
		} else {
			/*
			 * This must be a reference object produced by either the
+18 −5
Original line number Diff line number Diff line
@@ -368,6 +368,17 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
								*)obj_desc);
		}

		switch (type) {
		case ACPI_TYPE_DEVICE:
		case ACPI_TYPE_THERMAL:

			/* These types have no attached subobject */
			break;

		default:

			/* All other types require a subobject */

			if (!obj_desc) {
				ACPI_ERROR((AE_INFO,
					    "[%4.4s] Node is unresolved or uninitialized",
@@ -375,6 +386,8 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
				return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE);
			}
			break;
		}
		break;

	default:
		return_ACPI_STATUS(AE_AML_OPERAND_TYPE);