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

Alexandre Courbot
2026-02-03T22:25:18Z

On Mon Feb 2, 2026 at 11:27 PM JST, Gary Guo wrote:
> 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.

Yup, along with the proper wrapper layout that Gary mentioned that looks
really nice and flows well within the code. I'll wait some more for more
feedback and send v2 if there are no objections about the general
direction of the patchset.