Thread (27 messages) 27 messages, 4 authors, 2025-09-25

Re: [PATCH V7 2/4] asm-generic/io.h: Add big-endian MMIO accessors

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2025-09-23 18:38:27
Also in: linux-arch, linux-hardening, linux-i3c, lkml

On Tue, Sep 23, 2025, at 17:45, Manikanta Guntupalli wrote:
Add MMIO accessors to support big-endian memory operations. These helpers
include {read, write}{w, l, q}_be() and {read, write}s{w, l, q}_be(),
which allows to access big-endian memory regions while returning
the results in the CPU’s native endianness.

This provides a consistent interface to interact with hardware using
big-endian register layouts.

Signed-off-by: Manikanta Guntupalli <redacted>
I feel like we already have too many accessor functions like these,
what's wrong with just using io{read,write}{8,16,32,64}be() in
your driver?

On most architectures (including arm, riscv, powerpc and microblaze,
but not x86), the ioread/write helpers are identical to the
readl/writel style helpers, the only difference being that on x86
they add an extra indirection for the port I/O check.

At the moment, there are only six drivers that use the
io{read,write}{8,16,32,64}be() style helpers. They
are all powerpc specific and can probably be changed
to io{read,write}be.

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help