Re: [PATCH 3/6] rust: io: provide Mmio relaxed ops through a wrapper type

From: Danilo Krummrich

Date: Mon Feb 02 2026 - 09:23:36 EST


On Mon Feb 2, 2026 at 3:18 PM CET, Danilo Krummrich wrote:
> On Mon Feb 2, 2026 at 3:07 PM CET, Gary Guo wrote:
>> I think ultimately choice of order to use for each I/O access is local to the
>> specific access, not a global property.
>>
>> I know you can just do `RelaxedMmio::from(io).access()` for each single access
>> too, but it feels quite verbose.
>
> mmio.relaxed().access() would work as well.
>
>> I guess one alternative design is explicit order on the access, e.g.
>>
>> io.read32(Relaxed)
>>
>> Or
>>
>> io.read32(Full)
>>
>> however this is verbose in some other ways... I'd like to hear how Boqun thinks
>> on this one.
>
> This apprach would be misleading for a lot of other I/O backends. For instance,
> the I2C bus has no relaxed ordering.

Forgot to mention, relaxed ordering accesses are far less common, hence this
would become unnecessarily verbose.