[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <B50EAE3F-A424-4DC9-A2B0-7D9A8529B496@collabora.com>
Date: Wed, 4 Feb 2026 12:00:17 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Danilo Krummrich <dakr@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Krzysztof Wilczyński <kwilczynski@...nel.org>,
driver-core@...ts.linux.dev,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org,
Zhi Wang <zhiw@...dia.com>,
Lyude Paul <lyude@...hat.com>,
Eliot Courtney <ecourtney@...dia.com>
Subject: Re: [PATCH 2/6] rust: io: mem: use non-relaxed I/O ops in examples
> On 2 Feb 2026, at 05:13, Alexandre Courbot <acourbot@...dia.com> wrote:
>
> The `_relaxed` I/O variant methods are about to be replaced by a wrapper
> type exposing this access pattern with the regular methods of the `Io`
> trait. Thus replace the examples to use the regular I/O methods.
>
> Since these are examples, we want them to use the most standard ops
> anyway, and the relaxed variants were but an addition that was
> MMIO-specific.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
> rust/kernel/io/mem.rs | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/rust/kernel/io/mem.rs b/rust/kernel/io/mem.rs
> index 620022cff401..7dc78d547f7a 100644
> --- a/rust/kernel/io/mem.rs
> +++ b/rust/kernel/io/mem.rs
> @@ -54,6 +54,7 @@ pub(crate) unsafe fn new(device: &'a Device<Bound>, resource: &'a Resource) -> S
> /// use kernel::{
> /// bindings,
> /// device::Core,
> + /// io::Io,
> /// of,
> /// platform,
> /// };
> @@ -78,9 +79,9 @@ pub(crate) unsafe fn new(device: &'a Device<Bound>, resource: &'a Resource) -> S
> /// let io = iomem.access(pdev.as_ref())?;
> ///
> /// // Read and write a 32-bit value at `offset`.
> - /// let data = io.read32_relaxed(offset);
> + /// let data = io.read32(offset);
> ///
> - /// io.write32_relaxed(data, offset);
> + /// io.write32(data, offset);
> ///
> /// # Ok(SampleDriver)
> /// }
> @@ -117,6 +118,7 @@ pub fn iomap_exclusive_sized<const SIZE: usize>(
> /// use kernel::{
> /// bindings,
> /// device::Core,
> + /// io::Io,
> /// of,
> /// platform,
> /// };
> @@ -141,9 +143,9 @@ pub fn iomap_exclusive_sized<const SIZE: usize>(
> ///
> /// let io = iomem.access(pdev.as_ref())?;
> ///
> - /// let data = io.try_read32_relaxed(offset)?;
> + /// let data = io.try_read32(offset)?;
> ///
> - /// io.try_write32_relaxed(data, offset)?;
> + /// io.try_write32(data, offset)?;
> ///
> /// # Ok(SampleDriver)
> /// }
>
> --
> 2.52.0
>
>
Reviewed-by: Daniel Almeida <daniel.almeida@...labora.com>
Powered by blists - more mailing lists