LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Arnd Bergmann' <arnd@arndb.de>, Boqun Feng <boqun.feng@gmail.com>
Cc: linux-arch <linux-arch@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Wedson Almeida Filho <wedsonaf@google.com>,
	Gary Guo <gary@garyguo.net>, Hector Martin <marcan@marcan.st>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: RE: [Question] Alignment requirement for readX() and writeX()
Date: Mon, 2 Aug 2021 08:37:02 +0000	[thread overview]
Message-ID: <7353d0d46f9f4a908b73ac0ff1c070fc@AcuMS.aculab.com> (raw)
In-Reply-To: <CAK8P3a0w09Ga_OXAqhA0JcgR-LBc32a296dZhpTyPDwVSgaNkw@mail.gmail.com>

From: Arnd Bergmann
> Sent: 30 July 2021 17:59
...
> I am not aware of any driver that requires unaligned access on __iomem
> pointers, and since it definitely doesn't work on most architectures, ...

Unaligned accesses into PCIe space can generate a TLP that requests
only some bytes of the first and last 32bit words be transferred.
The target is expected to honour such requests.

On the x86 systems where I've looked at a TLP trace misaligned
accesses are even atomic provided the target doesn't let a local
request interleave.

OTOH drivers are unlikely to make such requests.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

      parent reply	other threads:[~2021-08-02  8:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 16:42 Boqun Feng
2021-07-30 16:58 ` Arnd Bergmann
2021-07-30 17:30   ` Boqun Feng
2021-07-30 20:24     ` Arnd Bergmann
2021-07-31  1:51       ` Boqun Feng
2021-08-02  8:37   ` David Laight [this message]

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=7353d0d46f9f4a908b73ac0ff1c070fc@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=wedsonaf@google.com \
    --subject='RE: [Question] Alignment requirement for readX() and writeX()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).