提交 a3ea14df 编写于 作者: P Paul Fox 提交者: Ingo Molnar

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: NPaul Fox <pgf@laptop.org>
Signed-off-by: NDaniel Drake <dsd@laptop.org>
Acked-by: NAndres Salomon <dilinger@queued.net>
Cc: <stable@kernel.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 140d0b21
...@@ -161,13 +161,13 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen, ...@@ -161,13 +161,13 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
if (inbuf && inlen) { if (inbuf && inlen) {
/* write data to EC */ /* write data to EC */
for (i = 0; i < inlen; i++) { for (i = 0; i < inlen; i++) {
pr_devel("olpc-ec: sending cmd arg 0x%x\n", inbuf[i]);
outb(inbuf[i], 0x68);
if (wait_on_ibf(0x6c, 0)) { if (wait_on_ibf(0x6c, 0)) {
printk(KERN_ERR "olpc-ec: timeout waiting for" printk(KERN_ERR "olpc-ec: timeout waiting for"
" EC accept data!\n"); " EC accept data!\n");
goto err; goto err;
} }
pr_devel("olpc-ec: sending cmd arg 0x%x\n", inbuf[i]);
outb(inbuf[i], 0x68);
} }
} }
if (outbuf && outlen) { if (outbuf && outlen) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册