[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DG6A23IKOR3S.E8UNRLDT8GRD@kernel.org>
Date: Wed, 04 Feb 2026 16:20:20 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Link Mauve" <linkmauve@...kmauve.fr>
Cc: <rust-for-linux@...r.kernel.org>, "Madhavan Srinivasan"
<maddy@...ux.ibm.com>, "Michael Ellerman" <mpe@...erman.id.au>, "Nicholas
Piggin" <npiggin@...il.com>, "Christophe Leroy (CS GROUP)"
<chleroy@...nel.org>, "Srinivas Kandagatla" <srini@...nel.org>, "Miguel
Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun@...nel.org>, "Gary Guo"
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "Daniel Almeida"
<daniel.almeida@...labora.com>, "Ard Biesheuvel" <ardb@...nel.org>, "Martin
K. Petersen" <martin.petersen@...cle.com>, "Eric Biggers"
<ebiggers@...gle.com>, "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Lyude Paul" <lyude@...hat.com>, "Asahi Lina" <lina+kernel@...hilina.net>,
"Viresh Kumar" <viresh.kumar@...aro.org>, "Lorenzo Stoakes"
<lorenzo.stoakes@...cle.com>, "Tamir Duberstein" <tamird@...nel.org>,
"FUJITA Tomonori" <fujita.tomonori@...il.com>,
<linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>,
<officialTechflashYT@...il.com>, "Ash Logan" <ash@...quark.com>, "Roberto
Van Eeden" <rw-r-r-0644@...tonmail.com>,
Jonathan Neuschäfer <j.neuschaefer@....net>
Subject: Re: [PATCH v2 1/4] rust: io: Add big-endian read and write
functions
On Wed Feb 4, 2026 at 4:18 PM CET, Danilo Krummrich wrote:
> On Wed Feb 4, 2026 at 5:04 AM CET, Link Mauve wrote:
>> Another option would be to call u32::swap_bytes() on the data being
>> read/written, but these helpers make the Rust code as ergonomic as the C
>> code.
>>
>> Signed-off-by: Link Mauve <linkmauve@...kmauve.fr>
>
> The I/O stuff recently changed quite significantly, please have a look at the
> driver-core-next branch [1] in the driver-core tree.
>
> Also, instead of providing additional *be() methods, we should just create a new
> type io::Endianness and use it to indicate the device endianness when requesting
> the I/O resource.
>
> For instance, for your driver we could have
>
> request.iomap_exclusive_sized::<8>(Endianness::Big)?
>
> and then let the I/O backend choose the correct accessors based on this.
>
> I.e. the device is either big or little endian, hence we don't need to provide
> both accessors at the same time.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/log/?h=driver-core-next
Forgot to mention, please also consider this patch series [2] for your work.
[2] https://lore.kernel.org/all/20260202-io-v1-0-9bb2177d23be@nvidia.com/
Powered by blists - more mailing lists