[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFUU4ABJQ3PW.15VQSR9ZOSG9F@nvidia.com>
Date: Thu, 22 Jan 2026 13:31:34 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Zhi Wang" <zhiw@...dia.com>
Cc: <rust-for-linux@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <dakr@...nel.org>, <aliceryhl@...gle.com>,
<bhelgaas@...gle.com>, <kwilczynski@...nel.org>, <ojeda@...nel.org>,
<alex.gaynor@...il.com>, <boqun.feng@...il.com>, <gary@...yguo.net>,
<bjorn3_gh@...tonmail.com>, <lossin@...nel.org>, <a.hindborg@...nel.org>,
<tmgross@...ch.edu>, <markus.probst@...teo.de>, <helgaas@...nel.org>,
<cjia@...dia.com>, <smitra@...dia.com>, <ankita@...dia.com>,
<aniketa@...dia.com>, <kwankhede@...dia.com>, <targupta@...dia.com>,
<joelagnelf@...dia.com>, <jhubbard@...dia.com>, <zhiwang@...nel.org>,
<daniel.almeida@...labora.com>
Subject: Re: [PATCH v12 5/5] sample: rust: pci: add tests for config space
routines
On Thu Jan 22, 2026 at 5:22 AM JST, Zhi Wang wrote:
> Add tests exercising the PCI configuration space helpers.
>
> Suggested-by: Danilo Krummrich <dakr@...nel.org>
> Signed-off-by: Zhi Wang <zhiw@...dia.com>
> ---
> samples/rust/rust_driver_pci.rs | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs
> index 38c949efce38..1bc5bd1a8df5 100644
> --- a/samples/rust/rust_driver_pci.rs
> +++ b/samples/rust/rust_driver_pci.rs
> @@ -5,6 +5,7 @@
> //! To make this driver probe, QEMU must be run with `-device pci-testdev`.
>
> use kernel::{
> + device::Bound,
> device::Core,
> devres::Devres,
> io::Io,
> @@ -65,6 +66,32 @@ fn testdev(index: &TestIndex, bar: &Bar0) -> Result<u32> {
>
> Ok(bar.read32(Regs::COUNT))
> }
> +
> + fn config_space(pdev: &pci::Device<Bound>) -> Result {
> + let config = pdev.config_space()?;
> +
> + // TODO: use the register!() macro for defining PCI configuration space registers once it
I'll rebase the `register!` series on top of this and try to address
this item.
For now,
Reviewed-by: Alexandre Courbot <acourbot@...dia.com>
Powered by blists - more mailing lists