Thread (13 messages) 13 messages, 3 authors, 2021-02-16

Re: [PATCH v1 1/4] PCI: Introduce pcim_alloc_irq_vectors()

From: Krzysztof Wilczyński <hidden>
Date: 2021-02-16 14:43:18
Also in: linux-doc, linux-i2c, lkml

Hi Dejin and Andy,

[...]
quoted
quoted
Question: wouldn't you need to call pci_free_irq_vectors() somewhere,
possibly to pcim_release() callback?  Although, I am not sure where the
right place would be.

I am asking, as the documentation (see [4]) suggests that one would have
to release allocated IRQ vectors (relevant exceprt):
It's done in pcim_release() but not explicitly.

        if (dev->msi_enabled)
                pci_disable_msi(dev);
        if (dev->msix_enabled)
                pci_disable_msix(dev);

Maybe above can be replaced by pci_free_irq_vectors() to be sure that any
future change to PCI IRQ allocation APIs.

Yes, I have checked and currently the above code is equivalent to
pci_free_irq_vectors().

Dejin, please update your patch accordingly.
Hi Andy and Krzysztof,

I have modified it and sent patch v2. thank you very much!
Thank you Andy for double-checking!  Much appreciated.

Moving to pci_free_irq_vectors() directly looks great as we are also
removing the surplus checks that pcim_release() is doing - since both
the pci_disable_msi() and the pci_disable_msix() are doing internal
validation to see whether MSI/MSI-X is currently enabled.

Thank you again, Dejin and Andy. :)

Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help