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

Commit 3dd6786f authored by Len Brown's avatar Len Brown
Browse files

Pull bugzilla-8385 into release branch

parents f697b677 88db5e14
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -231,8 +231,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
		 * Obtain the method mutex if necessary. Do not acquire mutex for a
		 * recursive call.
		 */
		if (acpi_os_get_thread_id() !=
		    obj_desc->method.mutex->mutex.owner_thread_id) {
		if (!walk_state ||
		    !obj_desc->method.mutex->mutex.owner_thread ||
		    (walk_state->thread !=
		     obj_desc->method.mutex->mutex.owner_thread)) {
			/*
			 * Acquire the method mutex. This releases the interpreter if we
			 * block (and reacquires it before it returns)
@@ -246,14 +248,14 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
			}

			/* Update the mutex and walk info and save the original sync_level */
			obj_desc->method.mutex->mutex.owner_thread_id =
				acpi_os_get_thread_id();

			if (walk_state) {
				obj_desc->method.mutex->mutex.
				    original_sync_level =
				    walk_state->thread->current_sync_level;

				obj_desc->method.mutex->mutex.owner_thread =
				    walk_state->thread;
				walk_state->thread->current_sync_level =
				    obj_desc->method.sync_level;
			} else {
@@ -567,7 +569,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,

			acpi_os_release_mutex(method_desc->method.mutex->mutex.
					      os_mutex);
			method_desc->method.mutex->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
			method_desc->method.mutex->mutex.owner_thread = NULL;
		}
	}

+4 −7
Original line number Diff line number Diff line
@@ -196,15 +196,12 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
		notify_info->notify.value = (u16) notify_value;
		notify_info->notify.handler_obj = handler_obj;

		acpi_ex_exit_interpreter();

		acpi_ev_notify_dispatch(notify_info);

		status = acpi_ex_enter_interpreter();
		status =
		    acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
				    notify_info);
		if (ACPI_FAILURE(status)) {
			return_ACPI_STATUS(status);
			acpi_ut_delete_generic_state(notify_info);
		}

	}

	if (!handler_obj) {
+4 −11
Original line number Diff line number Diff line
@@ -291,7 +291,6 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
			       u32 bit_width, acpi_integer * value)
{
	acpi_status status;
	acpi_status status2;
	acpi_adr_space_handler handler;
	acpi_adr_space_setup region_setup;
	union acpi_operand_object *handler_desc;
@@ -345,7 +344,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
		 * setup will potentially execute control methods
		 * (e.g., _REG method for this region)
		 */
		acpi_ex_exit_interpreter();
		acpi_ex_relinquish_interpreter();

		status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
				      handler_desc->address_space.context,
@@ -353,10 +352,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,

		/* Re-enter the interpreter */

		status2 = acpi_ex_enter_interpreter();
		if (ACPI_FAILURE(status2)) {
			return_ACPI_STATUS(status2);
		}
		acpi_ex_reacquire_interpreter();

		/* Check for failure of the Region Setup */

@@ -409,7 +405,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
		 * exit the interpreter because the handler *might* block -- we don't
		 * know what it will do, so we can't hold the lock on the intepreter.
		 */
		acpi_ex_exit_interpreter();
		acpi_ex_relinquish_interpreter();
	}

	/* Call the handler */
@@ -430,10 +426,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
		 * We just returned from a non-default handler, we must re-enter the
		 * interpreter
		 */
		status2 = acpi_ex_enter_interpreter();
		if (ACPI_FAILURE(status2)) {
			return_ACPI_STATUS(status2);
		}
		acpi_ex_reacquire_interpreter();
	}

	return_ACPI_STATUS(status);
+2 −4
Original line number Diff line number Diff line
@@ -768,11 +768,9 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
		return (AE_BAD_PARAMETER);
	}

	status = acpi_ex_enter_interpreter();
	if (ACPI_FAILURE(status)) {
		return (status);
	}
	/* Must lock interpreter to prevent race conditions */

	acpi_ex_enter_interpreter();
	status = acpi_ev_acquire_global_lock(timeout);
	acpi_ex_exit_interpreter();

+1 −4
Original line number Diff line number Diff line
@@ -583,10 +583,7 @@ acpi_ex_create_method(u8 * aml_start,
	 * Get the sync_level. If method is serialized, a mutex will be
	 * created for this method when it is parsed.
	 */
	if (acpi_gbl_all_methods_serialized) {
		obj_desc->method.sync_level = 0;
		obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
	} else if (method_flags & AML_METHOD_SERIALIZED) {
	if (method_flags & AML_METHOD_SERIALIZED) {
		/*
		 * ACPI 1.0: sync_level = 0
		 * ACPI 2.0: sync_level = sync_level in method declaration
Loading