[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D6227AA2-A727-4F29-B7CD-BE0AAB0A13F1@collabora.com>
Date: Thu, 5 Feb 2026 14:28:01 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Gary Guo <gary@...yguo.net>
Cc: Danilo Krummrich <dakr@...nel.org>,
Link Mauve <linkmauve@...kmauve.fr>,
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>,
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>,
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 5 Feb 2026, at 12:16, Gary Guo <gary@...yguo.net> wrote:
>
> On Thu Feb 5, 2026 at 2:28 PM GMT, Daniel Almeida wrote:
>>
>>
>>> On 4 Feb 2026, at 12:18, Danilo Krummrich <dakr@...nel.org> 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)?
>>
>> Can we please structure this in a way that LittleEndian is the default?
>> Perhaps using a const generic that is defaulted, or something along these lines.
>
> I think we should have everything default to little endian, and have wrapper
> types that do big endian which require expicit construction, similar to
> RelaxedMmio in Alex's series.
>
> Best,
> Gary
>
Ah yes, the RelaxedMmio pattern is definitely a good one. I agree that we should head in this direction.
— Daniel
Powered by blists - more mailing lists