<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/rust/helpers/pci.c, branch v7.0.10</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.0.10</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.0.10'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-12-15T21:39:11+00:00</updated>
<entry>
<title>rust: pci: add __rust_helper to helpers</title>
<updated>2025-12-15T21:39:11+00:00</updated>
<author>
<name>Alice Ryhl</name>
<email>aliceryhl@google.com</email>
</author>
<published>2025-12-02T19:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=593e0b22340c3b6aa19c0fa3c466b0809a7ba0d1'/>
<id>urn:sha1:593e0b22340c3b6aa19c0fa3c466b0809a7ba0d1</id>
<content type='text'>
This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://patch.msgid.link/20251202-define-rust-helper-v1-26-a2e13cbc17a6@google.com
[ Consider latest helper additions. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pci: fix build failure when CONFIG_PCI_MSI is disabled</title>
<updated>2025-12-03T11:24:47+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-12-02T21:01:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=473b9f331718267815649cd93801da832200db71'/>
<id>urn:sha1:473b9f331718267815649cd93801da832200db71</id>
<content type='text'>
When CONFIG_PCI_MSI is disabled pci_alloc_irq_vectors() and
pci_free_irq_vectors() are defined as inline functions and hence require
a Rust helper.

	error[E0425]: cannot find function `pci_alloc_irq_vectors` in crate `bindings`
	    --&gt; rust/kernel/pci/irq.rs:144:23
	     |
	 144 | ...s::pci_alloc_irq_vectors(dev.as_raw(), min_vecs, max_vecs, irq_types.as_raw())
	     |       ^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `pci_irq_vector`
	     |
	    ::: .../rust/bindings/bindings_helpers_generated.rs:1197:5
	     |
	1197 |     pub fn pci_irq_vector(pdev: *mut pci_dev, nvec: ffi::c_uint) -&gt; ffi::c_int;
	     |     --------------------------------------------------------------------------- similarly named function `pci_irq_vector` defined here

	error[E0425]: cannot find function `pci_free_irq_vectors` in crate `bindings`
	    --&gt; rust/kernel/pci/irq.rs:170:28
	     |
	 170 |         unsafe { bindings::pci_free_irq_vectors(self.dev.as_raw()) };
	     |                            ^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `pci_irq_vector`
	     |
	    ::: .../rust/bindings/bindings_helpers_generated.rs:1197:5
	     |
	1197 |     pub fn pci_irq_vector(pdev: *mut pci_dev, nvec: ffi::c_uint) -&gt; ffi::c_int;
	     |     --------------------------------------------------------------------------- similarly named function `pci_irq_vector` defined here

	error: aborting due to 2 previous errors

Fix this by adding the corresponding helpers.

Fixes: 340ccc973544 ("rust: pci: Allocate and manage PCI interrupt vectors")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202512012238.YgVvRRUx-lkp@intel.com/
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Joel Fernandes &lt;joelagnelf@nvidia.com&gt;
Link: https://patch.msgid.link/20251202210501.40998-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: Add several miscellaneous PCI helpers</title>
<updated>2025-08-15T18:25:42+00:00</updated>
<author>
<name>Alistair Popple</name>
<email>apopple@nvidia.com</email>
</author>
<published>2025-07-30T01:34:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b6a37d1d4694111895248b771513153ccace606a'/>
<id>urn:sha1:b6a37d1d4694111895248b771513153ccace606a</id>
<content type='text'>
Add bindings to obtain a PCI device's resource start address, bus/
device function, revision ID and subsystem device and vendor IDs.

These will be used by the nova-core GPU driver which is currently in
development.

Reviewed-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Cc: Danilo Krummrich &lt;dakr@kernel.org&gt;
Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Cc: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Cc: Alex Gaynor &lt;alex.gaynor@gmail.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Gary Guo &lt;gary@garyguo.net&gt;
Cc: Björn Roy Baron &lt;bjorn3_gh@protonmail.com&gt;
Cc: Benno Lossin &lt;lossin@kernel.org&gt;
Cc: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Cc: Alice Ryhl &lt;aliceryhl@google.com&gt;
Cc: Trevor Gross &lt;tmgross@umich.edu&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Cc: John Hubbard &lt;jhubbard@nvidia.com&gt;
Cc: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Cc: linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alistair Popple &lt;apopple@nvidia.com&gt;
Link: https://lore.kernel.org/r/20250730013417.640593-2-apopple@nvidia.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pci: add irq accessors</title>
<updated>2025-08-12T18:33:33+00:00</updated>
<author>
<name>Daniel Almeida</name>
<email>daniel.almeida@collabora.com</email>
</author>
<published>2025-08-11T16:03:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9b6d4fb9804febb1ae75e7259bb475cea58e28a7'/>
<id>urn:sha1:9b6d4fb9804febb1ae75e7259bb475cea58e28a7</id>
<content type='text'>
These accessors can be used to retrieve a irq::Registration or a
irq::ThreadedRegistration from a pci device. Alternatively, drivers can
retrieve an IrqRequest from a bound PCI device for later use.

These accessors ensure that only valid IRQ lines can ever be registered.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Tested-by: Joel Fernandes &lt;joelagnelf@nvidia.com&gt;
Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Link: https://lore.kernel.org/r/20250811-topics-tyr-request_irq2-v9-6-0485dcd9bcbf@collabora.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pci: use generic device drvdata accessors</title>
<updated>2025-07-08T22:04:33+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-06-21T19:43:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4231712c8e9840c023192032d438f98061b9ee1f'/>
<id>urn:sha1:4231712c8e9840c023192032d438f98061b9ee1f</id>
<content type='text'>
Take advantage of the generic drvdata accessors of the generic Device
type.

While at it, use from_result() instead of match.

Link: https://lore.kernel.org/r/20250621195118.124245-5-dakr@kernel.org
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pci: impl TryFrom&lt;&amp;Device&gt; for &amp;pci::Device</title>
<updated>2025-04-19T08:20:16+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-03-21T21:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a095d0d1e4849ee25c28d43d713a8f433d7f1f27'/>
<id>urn:sha1:a095d0d1e4849ee25c28d43d713a8f433d7f1f27</id>
<content type='text'>
Implement TryFrom&lt;&amp;device::Device&gt; for &amp;Device.

This allows us to get a &amp;pci::Device from a generic &amp;Device in a safe
way; the conversion fails if the device' bus type does not match with
the PCI bus type.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20250321214826.140946-3-dakr@kernel.org
[ Support device context types, use dev_is_pci() helper. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pci: add basic PCI device / driver abstractions</title>
<updated>2024-12-20T16:19:26+00:00</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2024-12-19T17:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1bd8b6b2c5d38d9881d59928b986eacba40f9da8'/>
<id>urn:sha1:1bd8b6b2c5d38d9881d59928b986eacba40f9da8</id>
<content type='text'>
Implement the basic PCI abstractions required to write a basic PCI
driver. This includes the following data structures:

The `pci::Driver` trait represents the interface to the driver and
provides `pci::Driver::probe` for the driver to implement.

The `pci::Device` abstraction represents a `struct pci_dev` and provides
abstractions for common functions, such as `pci::Device::set_master`.

In order to provide the PCI specific parts to a generic
`driver::Registration` the `driver::RegistrationOps` trait is implemented
by `pci::Adapter`.

`pci::DeviceId` implements PCI device IDs based on the generic
`device_id::RawDevceId` abstraction.

Co-developed-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Link: https://lore.kernel.org/r/20241219170425.12036-10-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
