提交 523953b4 编写于 作者: A Alexey Starikovskiy 提交者: Len Brown

ACPI: ec: Acquire Global Lock under EC mutex.

Signed-off-by: NLen Brown <len.brown@intel.com>
上级 50c1e113
...@@ -286,12 +286,12 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, ...@@ -286,12 +286,12 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
if (rdata) if (rdata)
memset(rdata, 0, rdata_len); memset(rdata, 0, rdata_len);
mutex_lock(&ec->lock);
if (ec->global_lock) { if (ec->global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return -ENODEV; return -ENODEV;
} }
mutex_lock(&ec->lock);
/* Make sure GPE is enabled before doing transaction */ /* Make sure GPE is enabled before doing transaction */
acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
...@@ -307,10 +307,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, ...@@ -307,10 +307,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
rdata, rdata_len); rdata, rdata_len);
end: end:
mutex_unlock(&ec->lock);
if (ec->global_lock) if (ec->global_lock)
acpi_release_global_lock(glk); acpi_release_global_lock(glk);
mutex_unlock(&ec->lock);
return status; return status;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册