]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: io: provide Mmio relaxed ops through a wrapper type
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 6 Feb 2026 06:00:17 +0000 (15:00 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 17 Mar 2026 19:02:09 +0000 (20:02 +0100)
commit1d1c5c73d7e8f166b6b55ae06a3c509561b854cd
tree4244141fad33544e6b01a5630a03cd6a18a1e2b2
parent19103d4f93673c804ef82dd797cd2b935d0bf70f
rust: io: provide Mmio relaxed ops through a wrapper type

Relaxed I/O accessors for `Mmio` are currently implemented as an extra
set of methods that mirror the ones defined in `Io`, but with the
`_relaxed` suffix.

This makes these methods impossible to use with generic code, which is a
highly plausible proposition now that we have the `Io` trait.

Address this by adding a new `RelaxedMmio` wrapper type for `Mmio` that
provides its own `IoCapable` implementations relying on the relaxed C
accessors. This makes it possible to use relaxed operations on a `Mmio`
simply by wrapping it, and to use `RelaxedMmio` in code generic against
`Io`.

Acked-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260206-io-v2-3-71dea20a06e6@nvidia.com
[ Use kernel import style in examples. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/io.rs