Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117355
b: refs/heads/master
c: c0ff177
h: refs/heads/master
i:
  117353: dd164ea
  117351: f4e9e32
v: v3
  • Loading branch information
Alexey Starikovskiy authored and Len Brown committed Oct 16, 2008
1 parent 7529966 commit 8114488
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 455c8793d2c49eaecad038c8de83dade9fc3759f
refs/heads/master: c0ff17720ec5f42205b3d2ca03a18da0a8272976
15 changes: 13 additions & 2 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ static int ec_check_ibf0(struct acpi_ec *ec)
return (status & ACPI_EC_FLAG_IBF) == 0;
}

static int ec_wait_ibf0(struct acpi_ec *ec)
{
unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
/* interrupt wait manually if GPE mode is not active */
unsigned long timeout = test_bit(EC_FLAGS_GPE_MODE, &ec->flags) ?
msecs_to_jiffies(ACPI_EC_DELAY) : msecs_to_jiffies(1);
while (time_before(jiffies, delay))
if (wait_event_timeout(ec->wait, ec_check_ibf0(ec), timeout))
return 0;
return -ETIME;
}

static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t,
int force_poll)
{
Expand All @@ -315,8 +327,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t,
goto unlock;
}
}
if (!wait_event_timeout(ec->wait, ec_check_ibf0(ec),
msecs_to_jiffies(ACPI_EC_DELAY))) {
if (ec_wait_ibf0(ec)) {
pr_err(PREFIX "input buffer is not empty, "
"aborting transaction\n");
status = -ETIME;
Expand Down

0 comments on commit 8114488

Please sign in to comment.