rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: bhelgaas@google.com, kwilczynski@kernel.org,
	gregkh@linuxfoundation.org, rafael@kernel.org,
	abdiel.janulgue@gmail.com, ojeda@kernel.org,
	alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
	bjorn3_gh@protonmail.com, benno.lossin@proton.me,
	a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
	daniel.almeida@collabora.com, robin.murphy@arm.com,
	linux-pci@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 7/9] rust: pci: move iomap_region() to impl Device<Bound>
Date: Tue, 15 Apr 2025 15:43:31 -0500	[thread overview]
Message-ID: <20250415204331.GA34889@bhelgaas> (raw)
In-Reply-To: <20250413173758.12068-8-dakr@kernel.org>

On Sun, Apr 13, 2025 at 07:37:02PM +0200, Danilo Krummrich wrote:
> Require the Bound device context to be able to call iomap_region() and
> iomap_region_sized(). Creating I/O mapping requires the device to be
> bound.
> 
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  rust/kernel/pci.rs | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
> index 1234b0c4a403..3664d35b8e79 100644
> --- a/rust/kernel/pci.rs
> +++ b/rust/kernel/pci.rs
> @@ -390,7 +390,9 @@ pub fn resource_len(&self, bar: u32) -> Result<bindings::resource_size_t> {
>          // - by its type invariant `self.as_raw` is always a valid pointer to a `struct pci_dev`.
>          Ok(unsafe { bindings::pci_resource_len(self.as_raw(), bar.try_into()?) })
>      }
> +}
>  
> +impl Device<device::Bound> {
>      /// Mapps an entire PCI-BAR after performing a region-request on it. I/O operation bound checks
>      /// can be performed on compile time for offsets (plus the requested type size) < SIZE.

You didn't add these typos here, but

s/Mapps/Maps/
s/on compile time/at compile time/

>      pub fn iomap_region_sized<const SIZE: usize>(
> -- 
> 2.49.0
> 

  parent reply	other threads:[~2025-04-15 20:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-13 17:36 [PATCH v2 0/9] Implement "Bound" device context Danilo Krummrich
2025-04-13 17:36 ` [PATCH v2 1/9] rust: device: implement impl_device_context_deref! Danilo Krummrich
2025-04-13 19:38   ` Christian Schrefl
2025-04-14 10:41   ` Benno Lossin
2025-04-13 17:36 ` [PATCH v2 2/9] rust: device: implement impl_device_context_into_aref! Danilo Krummrich
2025-04-14 10:26   ` Benno Lossin
2025-04-13 17:36 ` [PATCH v2 3/9] rust: device: implement device context for Device Danilo Krummrich
2025-04-14 10:31   ` Benno Lossin
2025-04-15 20:47   ` Bjorn Helgaas
2025-04-13 17:36 ` [PATCH v2 4/9] rust: platform: preserve device context in AsRef Danilo Krummrich
2025-04-14 10:32   ` Benno Lossin
2025-04-13 17:37 ` [PATCH v2 5/9] rust: pci: " Danilo Krummrich
2025-04-14 10:33   ` Benno Lossin
2025-04-13 17:37 ` [PATCH v2 6/9] rust: device: implement Bound device context Danilo Krummrich
2025-04-14 10:44   ` Benno Lossin
2025-04-14 11:13     ` Danilo Krummrich
2025-04-14 12:15       ` Benno Lossin
2025-04-14 10:49   ` Benno Lossin
2025-04-14 10:56     ` Danilo Krummrich
2025-04-14 11:10       ` Benno Lossin
2025-04-15 20:44   ` Bjorn Helgaas
2025-04-13 17:37 ` [PATCH v2 7/9] rust: pci: move iomap_region() to impl Device<Bound> Danilo Krummrich
2025-04-14 10:44   ` Benno Lossin
2025-04-15 20:43   ` Bjorn Helgaas [this message]
2025-04-13 17:37 ` [PATCH v2 8/9] rust: devres: require a bound device Danilo Krummrich
2025-04-13 17:37 ` [PATCH v2 9/9] rust: dma: " Danilo Krummrich
2025-04-17 15:14 ` [PATCH v2 0/9] Implement "Bound" device context Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250415204331.GA34889@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=abdiel.janulgue@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).