public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: fix write*() I/O accessors
Date: Fri, 11 Feb 2011 23:31:37 +0100	[thread overview]
Message-ID: <4D55B8C9.8070605@free.fr> (raw)
In-Reply-To: <1297463148-6612-1-git-send-email-wd@denx.de>

Le 11/02/2011 23:25, Wolfgang Denk a ?crit :
> Commit 3c0659b "ARM: Avoid compiler optimization for readb, writeb
> and friends." introduced I/O accessors with memory barriers.
> Unfortunately the new write*() accessors introduced a bug:
>
> The problem is that the argument "v" gets evaluated twice.  This
> breaks code like used here (from "drivers/net/dnet.c"):
>
> 	for (i = 0; i<  wrsz; i++)
> 		writel(*bufp++,&dnet->regs->TX_DATA_FIFO);
>
> Use auxiliary variables to avoid such problems.
>
> Signed-off-by: Wolfgang Denk<wd@denx.de>
> Cc: Albert Aribaud<albert.aribaud@free.fr>
> Cc: Alexander Holler<holler@ahsoftware.de>
> Cc: Dirk Behme<dirk.behme@googlemail.com>
> ---
>
> This patch fixes a pretty nasty problem.  Everybody who has
> experienced strange failures on ARM lately should apply it ASAP and
> re-test.  As far as I can tell at least the following drivers are
> affected:
>
> drivers/net/dnet.c:		writel(*bufp++,&dnet->regs->TX_DATA_FIFO);
> drivers/usb/musb/musb_core.c:	writeb(*data++,&musbr->fifox[ep]);
> drivers/mmc/pxa_mmc.c:		writel(*src++, MMC_TXFIFO);
> drivers/mmc/mxcmmc.c:		writel(*buf++,&host->base->buffer_access);
> drivers/spi/davinci_spi.c:	writel(data1_reg_val | *txp++,&ds->regs->dat1);
>
> Albert, please apply ASAP!

Applied, available on u-boot-arm/master.

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-02-11 22:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11 22:25 [U-Boot] [PATCH] ARM: fix write*() I/O accessors Wolfgang Denk
2011-02-11 22:31 ` Albert ARIBAUD [this message]
2011-02-11 22:40   ` Wolfgang Denk
2011-02-11 22:51 ` Alexander Holler

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=4D55B8C9.8070605@free.fr \
    --to=albert.aribaud@free.fr \
    --cc=u-boot@lists.denx.de \
    /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