[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DG746O6SKUQ0.H2A7OAVXTFZB@kernel.org>
Date: Thu, 05 Feb 2026 15:56:51 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Daniel Almeida" <daniel.almeida@...labora.com>
Cc: "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>, "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>, "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 Thu Feb 5, 2026 at 3:28 PM CET, 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.
Yes, little-endian should absolutely be the default. Please don't take the above
as specific suggestion. :)
>>
>> 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
>>
Powered by blists - more mailing lists