rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments
@ 2025-10-19  4:56 Peter Colberg
  2025-10-19  4:56 ` [PATCH 1/2] rust: pci: refer to legacy as INTx interrupts Peter Colberg
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Peter Colberg @ 2025-10-19  4:56 UTC (permalink / raw)
  To: Danilo Krummrich, Miguel Ojeda, Alex Gaynor
  Cc: Bjorn Helgaas, Krzysztof Wilczyński, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, linux-pci, rust-for-linux, linux-kernel,
	Peter Colberg

This patch series normalises the comments of the Rust PCI abstractions
to consistently refer to legacy as INTx interrupts and use the spelling
PCI BAR, as a way to familiarise myself with the Rust for Linux project.

Peter Colberg (2):
  rust: pci: refer to legacy as INTx interrupts
  rust: pci: normalise spelling of PCI BAR

 rust/kernel/pci.rs | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] rust: pci: refer to legacy as INTx interrupts
  2025-10-19  4:56 [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Peter Colberg
@ 2025-10-19  4:56 ` Peter Colberg
  2025-10-19  4:56 ` [PATCH 2/2] rust: pci: normalise spelling of PCI BAR Peter Colberg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Colberg @ 2025-10-19  4:56 UTC (permalink / raw)
  To: Danilo Krummrich, Miguel Ojeda, Alex Gaynor
  Cc: Bjorn Helgaas, Krzysztof Wilczyński, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, linux-pci, rust-for-linux, linux-kernel,
	Peter Colberg, Bjorn Helgaas

Consistently use INTx, as in the description of IrqType::Intx, to refer
to the four legacy PCI interrupts, INTA#, INTB#, INTC#, and INTD#.

Link: https://lore.kernel.org/rust-for-linux/20251015230209.GA960343@bhelgaas/
Link: https://github.com/Rust-for-Linux/linux/issues/1196
Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Peter Colberg <pcolberg@redhat.com>
---
 rust/kernel/pci.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
index d91ec9f008ae..18f9b92a745e 100644
--- a/rust/kernel/pci.rs
+++ b/rust/kernel/pci.rs
@@ -56,7 +56,7 @@ const fn as_raw(self) -> u32 {
 pub struct IrqTypes(u32);
 
 impl IrqTypes {
-    /// Create a set containing all IRQ types (MSI-X, MSI, and Legacy).
+    /// Create a set containing all IRQ types (MSI-X, MSI, and INTx).
     pub const fn all() -> Self {
         Self(bindings::PCI_IRQ_ALL_TYPES)
     }
@@ -66,7 +66,7 @@ pub const fn all() -> Self {
     /// # Examples
     ///
     /// ```ignore
-    /// // Create a set with only MSI and MSI-X (no legacy interrupts).
+    /// // Create a set with only MSI and MSI-X (no INTx interrupts).
     /// let msi_only = IrqTypes::default()
     ///     .with(IrqType::Msi)
     ///     .with(IrqType::MsiX);
@@ -722,9 +722,9 @@ pub fn request_threaded_irq<'a, T: crate::irq::ThreadedHandler + 'static>(
     /// Allocate IRQ vectors for this PCI device with automatic cleanup.
     ///
     /// Allocates between `min_vecs` and `max_vecs` interrupt vectors for the device.
-    /// The allocation will use MSI-X, MSI, or legacy interrupts based on the `irq_types`
+    /// The allocation will use MSI-X, MSI, or INTx interrupts based on the `irq_types`
     /// parameter and hardware capabilities. When multiple types are specified, the kernel
-    /// will try them in order of preference: MSI-X first, then MSI, then legacy interrupts.
+    /// will try them in order of preference: MSI-X first, then MSI, then INTx interrupts.
     ///
     /// The allocated vectors are automatically freed when the device is unbound, using the
     /// devres (device resource management) system.
@@ -748,7 +748,7 @@ pub fn request_threaded_irq<'a, T: crate::irq::ThreadedHandler + 'static>(
     /// // Allocate using any available interrupt type in the order mentioned above.
     /// let vectors = dev.alloc_irq_vectors(1, 32, pci::IrqTypes::all())?;
     ///
-    /// // Allocate MSI or MSI-X only (no legacy interrupts).
+    /// // Allocate MSI or MSI-X only (no INTx interrupts).
     /// let msi_only = pci::IrqTypes::default()
     ///     .with(pci::IrqType::Msi)
     ///     .with(pci::IrqType::MsiX);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] rust: pci: normalise spelling of PCI BAR
  2025-10-19  4:56 [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Peter Colberg
  2025-10-19  4:56 ` [PATCH 1/2] rust: pci: refer to legacy as INTx interrupts Peter Colberg
@ 2025-10-19  4:56 ` Peter Colberg
  2025-10-20 11:43 ` [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Danilo Krummrich
  2025-10-23 19:55 ` Danilo Krummrich
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Colberg @ 2025-10-19  4:56 UTC (permalink / raw)
  To: Danilo Krummrich, Miguel Ojeda, Alex Gaynor
  Cc: Bjorn Helgaas, Krzysztof Wilczyński, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, linux-pci, rust-for-linux, linux-kernel,
	Peter Colberg, Bjorn Helgaas

Consistently refer to PCI base address register as PCI BAR.
Fix spelling mistake "Mapps" -> "Maps".

Link: https://lore.kernel.org/rust-for-linux/20251015225827.GA960157@bhelgaas/
Link: https://github.com/Rust-for-Linux/linux/issues/1196
Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Peter Colberg <pcolberg@redhat.com>
---
 rust/kernel/pci.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
index 18f9b92a745e..747a0487d1e5 100644
--- a/rust/kernel/pci.rs
+++ b/rust/kernel/pci.rs
@@ -363,7 +363,7 @@ pub struct Device<Ctx: device::DeviceContext = device::Normal>(
 /// # Invariants
 ///
 /// `Bar` always holds an `IoRaw` inststance that holds a valid pointer to the start of the I/O
-/// memory mapped PCI bar and its size.
+/// memory mapped PCI BAR and its size.
 pub struct Bar<const SIZE: usize = 0> {
     pdev: ARef<Device>,
     io: IoRaw<SIZE>,
@@ -423,7 +423,7 @@ fn new(pdev: &Device, num: u32, name: &CStr) -> Result<Self> {
 
     /// # Safety
     ///
-    /// `ioptr` must be a valid pointer to the memory mapped PCI bar number `num`.
+    /// `ioptr` must be a valid pointer to the memory mapped PCI BAR number `num`.
     unsafe fn do_release(pdev: &Device, ioptr: usize, num: i32) {
         // SAFETY:
         // `pdev` is valid by the invariants of `Device`.
@@ -537,7 +537,7 @@ pub fn subsystem_device_id(&self) -> u16 {
         unsafe { (*self.as_raw()).subsystem_device }
     }
 
-    /// Returns the start of the given PCI bar resource.
+    /// Returns the start of the given PCI BAR resource.
     pub fn resource_start(&self, bar: u32) -> Result<bindings::resource_size_t> {
         if !Bar::index_is_valid(bar) {
             return Err(EINVAL);
@@ -549,7 +549,7 @@ pub fn resource_start(&self, bar: u32) -> Result<bindings::resource_size_t> {
         Ok(unsafe { bindings::pci_resource_start(self.as_raw(), bar.try_into()?) })
     }
 
-    /// Returns the size of the given PCI bar resource.
+    /// Returns the size of the given PCI BAR resource.
     pub fn resource_len(&self, bar: u32) -> Result<bindings::resource_size_t> {
         if !Bar::index_is_valid(bar) {
             return Err(EINVAL);
@@ -656,7 +656,7 @@ fn drop(&mut self) {
 }
 
 impl Device<device::Bound> {
-    /// Mapps an entire PCI-BAR after performing a region-request on it. I/O operation bound checks
+    /// Maps 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.
     pub fn iomap_region_sized<'a, const SIZE: usize>(
         &'a self,
@@ -666,7 +666,7 @@ pub fn iomap_region_sized<'a, const SIZE: usize>(
         Devres::new(self.as_ref(), Bar::<SIZE>::new(self, bar, name))
     }
 
-    /// Mapps an entire PCI-BAR after performing a region-request on it.
+    /// Maps an entire PCI BAR after performing a region-request on it.
     pub fn iomap_region<'a>(
         &'a self,
         bar: u32,
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments
  2025-10-19  4:56 [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Peter Colberg
  2025-10-19  4:56 ` [PATCH 1/2] rust: pci: refer to legacy as INTx interrupts Peter Colberg
  2025-10-19  4:56 ` [PATCH 2/2] rust: pci: normalise spelling of PCI BAR Peter Colberg
@ 2025-10-20 11:43 ` Danilo Krummrich
  2025-10-20 17:08   ` Peter Colberg
  2025-10-23 19:55 ` Danilo Krummrich
  3 siblings, 1 reply; 6+ messages in thread
From: Danilo Krummrich @ 2025-10-20 11:43 UTC (permalink / raw)
  To: Peter Colberg
  Cc: Miguel Ojeda, Alex Gaynor, Bjorn Helgaas,
	Krzysztof Wilczyński, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, linux-pci, rust-for-linux, linux-kernel

Hi Peter,

On Sun Oct 19, 2025 at 6:56 AM CEST, Peter Colberg wrote:
> This patch series normalises the comments of the Rust PCI abstractions
> to consistently refer to legacy as INTx interrupts and use the spelling
> PCI BAR, as a way to familiarise myself with the Rust for Linux project.

That's great to hear! :)

Can you please rebase the two patches on driver-core-testing [1]?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/log/?h=driver-core-testing

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments
  2025-10-20 11:43 ` [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Danilo Krummrich
@ 2025-10-20 17:08   ` Peter Colberg
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Colberg @ 2025-10-20 17:08 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: Miguel Ojeda, Alex Gaynor, Bjorn Helgaas,
	Krzysztof Wilczyński, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, linux-pci, rust-for-linux, linux-kernel

On Mon, Oct 20, 2025 at 01:43:16PM +0200, Danilo Krummrich wrote:
> On Sun Oct 19, 2025 at 6:56 AM CEST, Peter Colberg wrote:
> > This patch series normalises the comments of the Rust PCI abstractions
> > to consistently refer to legacy as INTx interrupts and use the spelling
> > PCI BAR, as a way to familiarise myself with the Rust for Linux project.
> 
> That's great to hear! :)
> 
> Can you please rebase the two patches on driver-core-testing [1]?
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/log/?h=driver-core-testing

Thanks Danilo, I have sent a v2 [2] rebased onto your "Rust PCI
housekeeping" patch series in driver-core-testing.

[2] https://lore.kernel.org/rust-for-linux/20251020170223.573769-1-pcolberg@redhat.com/

Peter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments
  2025-10-19  4:56 [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Peter Colberg
                   ` (2 preceding siblings ...)
  2025-10-20 11:43 ` [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Danilo Krummrich
@ 2025-10-23 19:55 ` Danilo Krummrich
  3 siblings, 0 replies; 6+ messages in thread
From: Danilo Krummrich @ 2025-10-23 19:55 UTC (permalink / raw)
  To: Peter Colberg
  Cc: Miguel Ojeda, Alex Gaynor, Bjorn Helgaas,
	Krzysztof Wilczyński, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, linux-pci, rust-for-linux, linux-kernel

On Sun Oct 19, 2025 at 6:56 AM CEST, Peter Colberg wrote:
> Peter Colberg (2):
>   rust: pci: refer to legacy as INTx interrupts
>   rust: pci: normalise spelling of PCI BAR

Applied to driver-core-testing, thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-23 19:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-19  4:56 [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Peter Colberg
2025-10-19  4:56 ` [PATCH 1/2] rust: pci: refer to legacy as INTx interrupts Peter Colberg
2025-10-19  4:56 ` [PATCH 2/2] rust: pci: normalise spelling of PCI BAR Peter Colberg
2025-10-20 11:43 ` [PATCH 0/2] rust: pci: consistently use INTx and PCI BAR in comments Danilo Krummrich
2025-10-20 17:08   ` Peter Colberg
2025-10-23 19:55 ` Danilo Krummrich

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