Re: [PATCH v2 5/5] rust: pci: expose the allocated interrupt type
"Danilo Krummrich" <[email protected]>
| Newsgroups | dev.linux.lists.driver-core,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Wed Aug 12, 2026 at 6:44 PM CEST, Gary Guo wrote:
> On Wed Aug 12, 2026 at 12:39 AM BST, Danilo Krummrich wrote:
>> + pub fn irq_type(&self) -> IrqType {
>> + self.reg.irq_type()
>
> Do you expect people to call this on the `IrqVetor` (or even
> `IrqVectorRegistration`)? This is really a property of the device, and not on a
> specific IRQ vector/allocation.
You are not wrong, but the C API sets msix_enabled and msi_enabled in
pci_alloc_irq_vectors() and clears them in pci_free_irq_vectors().
So, if we'd put it on Device<Bound> it'd be a bit of a footgun because it would
potentially yield different results depending on whether it is called before or
after obtaining an IrqVectorRegistration.