All of lore.kernel.org
 help / color / mirror / Atom feed
From: "André Przywara" <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] arm: introduce _relaxed MMIO accessors
Date: Wed, 6 Feb 2019 21:53:44 +0000	[thread overview]
Message-ID: <d0f39237-7c01-6b7a-e046-90bc83ad4fb5@arm.com> (raw)
In-Reply-To: <B1B71DAB-A3D8-498C-8C21-08BE38080E65@theobroma-systems.com>

On 06/02/2019 12:46, Philipp Tomsich wrote:
> On 11.01.2019, at 01:31, Andre Przywara <andre.przywara@arm.com> wrote:

Hi,

>>
>> The normal MMIO accessor macros (readX/writeX) guarantee a strong ordering,
>> even with normal memory accesses [1].
>> For some MMIO operations (framebuffers being a prominent example) this is
>> not needed, and the rather costly barrier inserted on weakly ordered
>> systems like ARM costs some performance.
>> To mitigate this issue, Linux introduced readX_relaxed and
>> writeX_relaxed primitives, which only guarantee ordering between each
>> other, so are typically faster due to the missing barrier.
>>
>> We probably do not care so much about performance in U-Boot, but want to
>> have those primitives for two other reasons:
>> - Being able to use the _relaxed macros simplifies porting drivers from
>>  Linux.
>> - The missing barrier typically allows to generate smaller code, which can
>>  relieve some chronically tight SPL builds.
>>
>> Add those macros definitions by using the __raw versions of the
>> accessors, which matches an earlier (and less complicated) version of
>> the Linux implementation.
>>
>> [1] https://lwn.net/Articles/698014/
> 
> No Signed-off-by?

Doh, indeed. Got so excited about my commit message, that I forgot the
obvious (and I only think about -s *after* hitting Enter).

> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> [On my experimental RK3399 after modifying a few drivers:]
> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Cool, many thanks for that! Out of curiosity, did you really need
*_relaxed for some reason?

Cheers,
Andre.

  reply	other threads:[~2019-02-06 21:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  0:31 [U-Boot] [PATCH 0/3] arm: Introduce writel/readl_relaxed accessors Andre Przywara
2019-01-11  0:31 ` [U-Boot] [PATCH 1/3] arm: clean up asm/io.h Andre Przywara
2019-02-06 12:49   ` Philipp Tomsich
2019-01-11  0:31 ` [U-Boot] [PATCH 2/3] arm: introduce _relaxed MMIO accessors Andre Przywara
2019-02-06 12:46   ` Philipp Tomsich
2019-02-06 21:53     ` André Przywara [this message]
2019-02-07  0:32       ` Philipp Tomsich
2019-01-11  0:31 ` [U-Boot] [PATCH 3/3] sunxi: H6: use writel_relaxed for DRAM timing register accesses Andre Przywara

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=d0f39237-7c01-6b7a-e046-90bc83ad4fb5@arm.com \
    --to=andre.przywara@arm.com \
    --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.