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

Commit 523953b4 authored by Alexey Starikovskiy's avatar Alexey Starikovskiy Committed by Len Brown
Browse files

ACPI: ec: Acquire Global Lock under EC mutex.



Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 50c1e113
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -286,12 +286,12 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
        if (rdata)
                memset(rdata, 0, rdata_len);

	mutex_lock(&ec->lock);
	if (ec->global_lock) {
		status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
		if (ACPI_FAILURE(status))
			return -ENODEV;
	}
	mutex_lock(&ec->lock);

	/* Make sure GPE is enabled before doing transaction */
	acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
@@ -307,10 +307,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
                                              rdata, rdata_len);

end:
	mutex_unlock(&ec->lock);

	if (ec->global_lock)
		acpi_release_global_lock(glk);
	mutex_unlock(&ec->lock);

	return status;
}