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

Gary Guo
2026-02-02T14:27:09Z

On Mon Feb 2, 2026 at 2:18 PM GMT, 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 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.

This is a fair point.

>>
>> 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.

Indeed, this looks nice.

Best,
Gary