x86, olpc: Wait for last byte of EC command to be accepted
[firefly-linux-kernel-4.4.55.git] / arch / x86 / platform / olpc / olpc.c
index 0060fd59ea001baaf1b31769bb1bbe6c490709ca..02e39345dc6dcababfc8f47b3b076df3174505f9 100644 (file)
@@ -157,13 +157,13 @@ restart:
        if (inbuf && inlen) {
                /* write data to EC */
                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)) {
                                printk(KERN_ERR "olpc-ec:  timeout waiting for"
                                                " EC accept data!\n");
                                goto err;
                        }
-                       pr_devel("olpc-ec:  sending cmd arg 0x%x\n", inbuf[i]);
-                       outb(inbuf[i], 0x68);
                }
        }
        if (outbuf && outlen) {