Skip to content

Commit

Permalink
ACPI: ec: Acquire Global Lock under EC mutex.
Browse files Browse the repository at this point in the history
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Alexey Starikovskiy authored and Len Brown committed Dec 8, 2006
1 parent 50c1e11 commit 523953b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 523953b

Please sign in to comment.