Re: [PATCH] rust: pci: add resource_flags accessor
From: Danilo Krummrich
Date: Fri Sep 11 2026 - 06:04:25 EST
On 9/8/26 9:51 AM, Eliot Courtney wrote:
> From: Joel Fernandes <joelagnelf@xxxxxxxxxx>
>
> Add a `Device::resource_flags()` method to the PCI Rust abstraction,
> wrapping the C-side static inline `pci_resource_flags()`.
>
> The flags returned correspond to the `IORESOURCE` bitmask carried by a
> PCI BAR's `struct resource`.
>
> The immediate motivation is BAR layout discovery on NVIDIA GPUs: a
> 64-bit BAR consumes two consecutive Linux PCI resource slots (the lower
> 32 bits at index N and the upper 32 bits at index N+1, with the latter
> having no flags or size of its own).
>
> Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>
> Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
> ---
> This is patch 1 of Joel's nova-core mm prerequisites series [1],
> reposted with no code changes. The rest of that series was folded into
> the PRAMIN series [2], which is now in drm-rust-next and didn't carry
> this patch. The upcoming nova-core memory management changes still need
> resource_flags().
>
> This is based on drm-rust-next.
Acked-by: Danilo Krummrich <dakr@xxxxxxxxxx>