PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
PATCH v2 1/1 PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
Commit 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled") fixed a build error by providing rust helpers when CONFIG_PCI_MSI=n. However the rust helpers rely on the pci_alloc_irq_vectors() function is defined, which is not true when CONFIG_PCI=n. There are multiple ways to fix this, e.g. a possible fix could be just remove the calling of pci_alloc_irq_vectors() since it's empty when CONFIG_PCI_MSI=n anyway. However, since PCI irq APIs, such as pci_alloc_irq_vectors(), are already defined even when CONFIG_PCI=n, the more reasonable fix is to define pci_alloc_irq_vectors() when CONFIG_PCI=n and this aligns with the situations of other primitives as well.
---
v1 --> v2:
* Add Reported-by from FUJITA Tomonori, kernel test robot and Liang Jie.
* Add Reviewed-by tags.
Thanks!
Liang Jie, I added you as Reported-by because of [1], if you prefer not to have that tag, feel free to let me know, thanks!
[1]: https://lore.kernel.org/rust-for-linux/[email protected]/
include/linux/pci.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/pci.h +4 -0
@@ -2210,6 +2210,10 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, {return -ENOSPC ; } + +static inline void pci_free_irq_vectors (struct pci_dev *dev) +{ +}#endif /* CONFIG_PCI */ /* Include architecture-dependent settings and functions */
Signature · 1 line
2.51.0
Quoted 12 lines · Boqun Feng
Commit
473b9f331718("rust: pci: fix build failure whenCONFIG_PCI_MSIis disabled") fixed a build error by providing rust helpers whenCONFIG_PCI_MSI=n. However the rust helpers rely on thepci_alloc_irq_vectors()function is defined, which is not true whenCONFIG_PCI=n. There are multiple ways to fix this, e.g. a possible fix could be just remove the calling ofpci_alloc_irq_vectors()since it's empty whenCONFIG_PCI_MSI=nanyway. However, since PCI irq APIs, such aspci_alloc_irq_vectors(), are already defined even whenCONFIG_PCI=n, the more reasonable fix is to definepci_alloc_irq_vectors()whenCONFIG_PCI=nand this aligns with the situations of other primitives as well.
Ping ;-) Bjorn, would it be possible to take via pci tree? Thanks!
Regards,
Boqun
Quoted 46 lines
Reported-by FUJITA Tomonori <[email protected]>Reported-by kernel test robot <[email protected]>Reported-by Liang Jie <[email protected]>Fixes 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")Reviewed-by Drew Fustini <[email protected]>Reviewed-by David Gow <[email protected]>Reviewed-by Joel Fernandes <[email protected]>Reviewed-by Danilo Krummrich <[email protected]>Signed-off-by Boqun Feng <[email protected]>---
v1 --> v2:* Add Reported-by from FUJITA Tomonori, kernel test robot and Liang Jie.
* Add Reviewed-by tags.Thanks!
Liang Jie, I added you as Reported-by because of [1], if you prefer not to have that tag, feel free to let me know, thanks!
[1]: https://lore.kernel.org/rust-for-linux/[email protected]/
include/linux/pci.h | 4 ++++ 1 file changed, 4 insertions(+)include/linux/pci.h +4
-0@@ -2210,6 +2210,10 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, {return -ENOSPC ; } + +static inline void pci_free_irq_vectors (struct pci_dev *dev) +{ +}#endif /* CONFIG_PCI */ /* Include architecture-dependent settings and functions */ Signature · 1 line
2.51.0
Danilo Krummrich
reviewerQuoted 12 lines · Boqun Feng
Commit
473b9f331718("rust: pci: fix build failure whenCONFIG_PCI_MSIis disabled") fixed a build error by providing rust helpers whenCONFIG_PCI_MSI=n. However the rust helpers rely on thepci_alloc_irq_vectors()function is defined, which is not true whenCONFIG_PCI=n. There are multiple ways to fix this, e.g. a possible fix could be just remove the calling ofpci_alloc_irq_vectors()since it's empty whenCONFIG_PCI_MSI=nanyway. However, since PCI irq APIs, such aspci_alloc_irq_vectors(), are already defined even whenCONFIG_PCI=n, the more reasonable fix is to definepci_alloc_irq_vectors()whenCONFIG_PCI=nand this aligns with the situations of other primitives as well.
Quoted 12 lines
Reported-by FUJITA Tomonori <[email protected]>Reported-by kernel test robot <[email protected]>Reported-by Liang Jie <[email protected]>Fixes 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")Reviewed-by Drew Fustini <[email protected]>Reviewed-by David Gow <[email protected]>Reviewed-by Joel Fernandes <[email protected]>Reviewed-by Danilo Krummrich <[email protected]>Signed-off-by Boqun Feng <[email protected]>
Bjorn, I just received another bug report due to this issue. Can you please pick this up for the next -rc?
If you don't have anything else to send, I can pick it up as well. :)
Thanks,
Danilo
Quoted 5 lines · Danilo Krummrich
Bjorn, I just received another bug report due to this issue. Can you please pick this up for the next -rc?
If you don't have anything else to send, I can pick it up as well. :)
Ditto!
Cheers,
Miguel
Bjorn Helgaas
AppliedQuoted 12 lines · Boqun Feng
Commit
473b9f331718("rust: pci: fix build failure whenCONFIG_PCI_MSIis disabled") fixed a build error by providing rust helpers whenCONFIG_PCI_MSI=n. However the rust helpers rely on thepci_alloc_irq_vectors()function is defined, which is not true whenCONFIG_PCI=n. There are multiple ways to fix this, e.g. a possible fix could be just remove the calling ofpci_alloc_irq_vectors()since it's empty whenCONFIG_PCI_MSI=nanyway. However, since PCI irq APIs, such aspci_alloc_irq_vectors(), are already defined even whenCONFIG_PCI=n, the more reasonable fix is to definepci_alloc_irq_vectors()whenCONFIG_PCI=nand this aligns with the situations of other primitives as well.
Quoted 12 lines
Reported-by FUJITA Tomonori <[email protected]>Reported-by kernel test robot <[email protected]>Reported-by Liang Jie <[email protected]>Fixes 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")Reviewed-by Drew Fustini <[email protected]>Reviewed-by David Gow <[email protected]>Reviewed-by Joel Fernandes <[email protected]>Reviewed-by Danilo Krummrich <[email protected]>Signed-off-by Boqun Feng <[email protected]>
Applied to pci/for-linus for v6.19, thanks!
I updated the commit log like this:
PCI: Provide pci_free_irq_vectors() stub
473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled") fixed a build error by providing Rust helpers when CONFIG_PCI_MSI is not set. However the Rust helpers rely on pci_free_irq_vectors(), which is only available when CONFIG_PCI=y.
When CONFIG_PCI is not set, there is already a stub for pci_alloc_irq_vectors(). Add a similar stub for pci_free_irq_vectors().
Quoted 34 lines
---
v1 --> v2:* Add Reported-by from FUJITA Tomonori, kernel test robot and Liang Jie.
* Add Reviewed-by tags.Thanks!
Liang Jie, I added you as Reported-by because of [1], if you prefer not to have that tag, feel free to let me know, thanks!
[1]: https://lore.kernel.org/rust-for-linux/[email protected]/
include/linux/pci.h | 4 ++++ 1 file changed, 4 insertions(+)include/linux/pci.h +4
-0@@ -2210,6 +2210,10 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, {return -ENOSPC ; } + +static inline void pci_free_irq_vectors (struct pci_dev *dev) +{ +}#endif /* CONFIG_PCI */ /* Include architecture-dependent settings and functions */ Signature · 1 line
2.51.0