The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andres Salomon <dilinger@queued.net>
To: Daniel Drake <dsd@laptop.org>
Cc: mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com,
	x86@kernel.org, pgf@laptop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86, olpc: Wait for last byte of EC command to be accepted
Date: Tue, 26 Jul 2011 09:24:27 -0700	[thread overview]
Message-ID: <20110726092427.3bce52a2@debxo> (raw)
In-Reply-To: <20110726154226.93A9F9D401C@zog.reactivated.net>

Acked-by: Andres Salomon <dilinger@queued.net>

After some squinting.. This patch looks correct.  This is a
long-standing issue, we should probably add a Cc: stable@kernel.org so
it gets picked up for stable kernels.

On Tue, 26 Jul 2011
16:42:26 +0100 (BST) Daniel Drake <dsd@laptop.org> wrote:

> From: Paul Fox <pgf@laptop.org>
> 
> 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.
> 
> Signed-off-by: Paul Fox <pgf@laptop.org>
> Signed-off-by: Daniel Drake <dsd@laptop.org>
> ---
>  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 8b9940e..7cce722 100644
> --- a/arch/x86/platform/olpc/olpc.c
> +++ b/arch/x86/platform/olpc/olpc.c
> @@ -161,13 +161,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) {


  reply	other threads:[~2011-07-26 16:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 15:42 [PATCH] x86, olpc: Wait for last byte of EC command to be accepted Daniel Drake
2011-07-26 16:24 ` Andres Salomon [this message]
2011-08-05 10:43 ` Ingo Molnar
2011-08-05 10:55   ` Daniel Drake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110726092427.3bce52a2@debxo \
    --to=dilinger@queued.net \
    --cc=dsd@laptop.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pgf@laptop.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox