diff options
author | Paul Fox <pgf@laptop.org> | 2011-07-26 11:42:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-08-05 17:47:55 -0400 |
commit | a3ea14df0e383f44dcb2e61badb71180dbffe526 (patch) | |
tree | 227eea7ae7604ca79d2477896df3c25150b676e9 /arch/x86 | |
parent | 140d0b2108faebc77c6523296e211e509cb9f5f9 (diff) |
x86, olpc: Wait for last byte of EC command to be accepted
When executing EC commands, only waiting when there are still
more bytes to write is usually fine. However, if the system
suspends very quickly after a call to olpc_ec_cmd(), the last
data byte may not yet be transferred to the EC, and the command
will not complete.
This solves a bug where the SCI wakeup mask was not correctly
written when going into suspend.
It means that sometimes, on XO-1.5 (but not XO-1), the
devices that were marked as wakeup sources can't wake up
the system. e.g. you ask for wifi wakeups, suspend, but then
incoming wifi frames don't wake up the system as they should.
Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Andres Salomon <dilinger@queued.net>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/platform/olpc/olpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c index 8b9940e78e2f..7cce722667b8 100644 --- a/arch/x86/platform/olpc/olpc.c +++ b/arch/x86/platform/olpc/olpc.c | |||
@@ -161,13 +161,13 @@ restart: | |||
161 | if (inbuf && inlen) { | 161 | if (inbuf && inlen) { |
162 | /* write data to EC */ | 162 | /* write data to EC */ |
163 | for (i = 0; i < inlen; i++) { | 163 | for (i = 0; i < inlen; i++) { |
164 | pr_devel("olpc-ec: sending cmd arg 0x%x\n", inbuf[i]); | ||
165 | outb(inbuf[i], 0x68); | ||
164 | if (wait_on_ibf(0x6c, 0)) { | 166 | if (wait_on_ibf(0x6c, 0)) { |
165 | printk(KERN_ERR "olpc-ec: timeout waiting for" | 167 | printk(KERN_ERR "olpc-ec: timeout waiting for" |
166 | " EC accept data!\n"); | 168 | " EC accept data!\n"); |
167 | goto err; | 169 | goto err; |
168 | } | 170 | } |
169 | pr_devel("olpc-ec: sending cmd arg 0x%x\n", inbuf[i]); | ||
170 | outb(inbuf[i], 0x68); | ||
171 | } | 171 | } |
172 | } | 172 | } |
173 | if (outbuf && outlen) { | 173 | if (outbuf && outlen) { |