All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v2] ARM: Avoid compiler optimization for usages	of readb, writeb and friends.
Date: Sun, 19 Dec 2010 17:34:32 +0100	[thread overview]
Message-ID: <4D0E3418.9050606@ahsoftware.de> (raw)
In-Reply-To: <4D0DEC74.4070300@free.fr>

Hello,

Am 19.12.2010 12:28, schrieb Albert ARIBAUD:
> Le 19/12/2010 11:22, Alexander Holler a ?crit :
>> Hello,
>>
>> On 19.12.2010 08:51, Dirk Behme wrote:
>>> On 18.12.2010 23:27, Alexander Holler wrote:
>>>> gcc 4.5.1 seems to ignore (at least some) volatile definitions,
>>>> avoid that as done in the kernel.
>>>>
>>
>>> Acked-by: Dirk Behme<dirk.behme@googlemail.com>
>>
>> Thanks for the ack, but I have to say, that those barriers are having
>> side effects here. Reading NAND now fails on my BeagleBoard. Regardless
>> if I use gcc 4.3.5 or gcc 4.5.1, after applying that patch the wrong ID
>> of the NAND is read. In nand_get_flash_type()
>> (drivers/mtd/nand/nand_base.c) without that patch I will get the following:
>>
>> *maf_id: 44, dev_id: 186
>>
>> with the patch the following is read:
>>
>> *maf_id: 128, dev_id: 85
>>
>> Which just is wrong.
>>
>> I haven't looked further up to now, maybe thats just a side effect of
>> some wrong clock settings because of different timings through those
>> barrieres or whatever.
>
> IIUC, the patch is adding barriers to every HW register write and read,
> which makes the compiler stop reordering these, and keep them ordered as
> in the source code. Are you sure that the order as laid out in the
> source is the right one? Maybe you were just luck so far that the
> reordering masked a bug.

I don't know much about all the stuff the omap3-drivers are doing. E.g. 
I've already wondered why it's necessary to measure a clock frequency in 
the code which got (wrongly) optimized without that patch. I would think 
such isn't necessary because I would assume the drivers are actually 
there to set the clock settings, and not to measure them. ;)

Regards,

Alexander

  reply	other threads:[~2010-12-19 16:34 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 22:27 [U-Boot] [RFC PATCH v2] ARM: Avoid compiler optimization for usages of readb, writeb and friends Alexander Holler
2010-12-19  7:51 ` Dirk Behme
2010-12-19 10:22   ` Alexander Holler
2010-12-19 11:28     ` Albert ARIBAUD
2010-12-19 16:34       ` Alexander Holler [this message]
2010-12-19 18:45     ` John Rigby
2010-12-19 19:59       ` Alexander Holler
2010-12-20  0:39         ` John Rigby
2010-12-20  0:56           ` Alexander Holler
2010-12-20  4:18             ` John Rigby
2010-12-20  6:07               ` John Rigby
2010-12-20  6:49                 ` Dirk Behme
2010-12-20  7:37                   ` John Rigby
2010-12-20 16:08                     ` John Rigby
2010-12-20 16:12                       ` John Rigby
2011-01-17  4:35                       ` Alexander Holler
2010-12-20 17:12                 ` Alexander Holler
2010-12-21  0:25                   ` John Rigby
2010-12-21  0:46                     ` John Rigby
2010-12-21  7:11                       ` Dirk Behme
2010-12-21  7:21                         ` Albert ARIBAUD
2010-12-21  8:05                           ` Dirk Behme
2010-12-21  8:17                             ` Wolfgang Denk
2010-12-21  8:37                               ` Dirk Behme
2010-12-21  8:35                           ` Dirk Behme
2010-12-21  8:46                             ` John Rigby
2010-12-21 10:38                               ` Albert ARIBAUD
2010-12-21 10:53                                 ` Wolfgang Denk
2010-12-21 12:35                                   ` Alexander Holler
2010-12-21 12:51                                     ` Albert ARIBAUD
2010-12-21 13:30                                       ` Alexander Holler
2010-12-21 14:33                                         ` Albert ARIBAUD
2010-12-21 19:52                                           ` Wolfgang Denk
2010-12-21 20:04                                             ` Dirk Behme
2010-12-21 21:49                                               ` Albert ARIBAUD
2010-12-22  0:11                                               ` Alexander Holler
2010-12-22  7:02                                                 ` Albert ARIBAUD
2010-12-22  7:18                                                   ` Dirk Behme
2010-12-22  7:52                                                     ` Wolfgang Denk
2010-12-23 16:40                                                       ` Dirk Behme
2010-12-22  9:56                                                   ` Alexander Holler
2010-12-21 13:38                     ` Alexander Holler
2010-12-22  8:02 ` Wolfgang Denk
2010-12-22 11:23   ` Alexander Holler
2010-12-29  9:40   ` Dirk Behme
2010-12-29 23:10     ` Alessandro Rubini
2010-12-30 10:39       ` Dirk Behme
2011-01-09 22:03       ` Wolfgang Denk

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=4D0E3418.9050606@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.