public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
@ 2025-12-26 11:39 Boqun Feng
  2026-01-05  6:08 ` Boqun Feng
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Boqun Feng @ 2025-12-26 11:39 UTC (permalink / raw)
  To: Danilo Krummrich, Bjorn Helgaas, Miguel Ojeda
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Joel Fernandes,
	linux-pci, linux-kernel, rust-for-linux, Dirk Behme,
	FUJITA Tomonori, kernel test robot, Liang Jie, Drew Fustini,
	David Gow

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.

Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Closes: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512220740.4Kexm4dW-lkp@intel.com/
Reported-by: Liang Jie <liangjie@lixiang.com>
Closes: https://lore.kernel.org/rust-for-linux/20251222034415.1384223-1-buaajxlj@163.com/
Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
Reviewed-by: Drew Fustini <fustini@kernel.org>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
---
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/20251222034415.1384223-1-buaajxlj@163.com/

 include/linux/pci.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 864775651c6f..b5cc0c2b9906 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -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 */
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
  2025-12-26 11:39 [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
@ 2026-01-05  6:08 ` Boqun Feng
  2026-01-12 16:30 ` Danilo Krummrich
  2026-01-12 17:06 ` Bjorn Helgaas
  2 siblings, 0 replies; 5+ messages in thread
From: Boqun Feng @ 2026-01-05  6:08 UTC (permalink / raw)
  To: Danilo Krummrich, Bjorn Helgaas, Miguel Ojeda
  Cc: Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Joel Fernandes, linux-pci, linux-kernel,
	rust-for-linux, Dirk Behme, FUJITA Tomonori, kernel test robot,
	Liang Jie, Drew Fustini, David Gow

On Fri, Dec 26, 2025 at 07:39:38PM +0800, Boqun Feng wrote:
> 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.
> 

Ping ;-) Bjorn, would it be possible to take via pci tree? Thanks!

Regards,
Boqun

> Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512220740.4Kexm4dW-lkp@intel.com/
> Reported-by: Liang Jie <liangjie@lixiang.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251222034415.1384223-1-buaajxlj@163.com/
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Reviewed-by: Drew Fustini <fustini@kernel.org>
> Reviewed-by: David Gow <davidgow@google.com>
> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
> Reviewed-by: Danilo Krummrich <dakr@kernel.org>
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> ---
> 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/20251222034415.1384223-1-buaajxlj@163.com/
> 
>  include/linux/pci.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 864775651c6f..b5cc0c2b9906 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -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 */
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
  2025-12-26 11:39 [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
  2026-01-05  6:08 ` Boqun Feng
@ 2026-01-12 16:30 ` Danilo Krummrich
  2026-01-12 17:03   ` Miguel Ojeda
  2026-01-12 17:06 ` Bjorn Helgaas
  2 siblings, 1 reply; 5+ messages in thread
From: Danilo Krummrich @ 2026-01-12 16:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Boqun Feng, Miguel Ojeda, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Joel Fernandes, linux-pci, linux-kernel, rust-for-linux,
	Dirk Behme, FUJITA Tomonori, kernel test robot, Liang Jie,
	Drew Fustini, David Gow

On Fri Dec 26, 2025 at 12:39 PM CET, Boqun Feng wrote:
> 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.
>
> Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512220740.4Kexm4dW-lkp@intel.com/
> Reported-by: Liang Jie <liangjie@lixiang.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251222034415.1384223-1-buaajxlj@163.com/
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Reviewed-by: Drew Fustini <fustini@kernel.org>
> Reviewed-by: David Gow <davidgow@google.com>
> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
> Reviewed-by: Danilo Krummrich <dakr@kernel.org>
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
  2026-01-12 16:30 ` Danilo Krummrich
@ 2026-01-12 17:03   ` Miguel Ojeda
  0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2026-01-12 17:03 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: Bjorn Helgaas, Boqun Feng, Miguel Ojeda, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Joel Fernandes, linux-pci, linux-kernel,
	rust-for-linux, Dirk Behme, FUJITA Tomonori, kernel test robot,
	Liang Jie, Drew Fustini, David Gow

On Mon, Jan 12, 2026 at 5:30 PM Danilo Krummrich <dakr@kernel.org> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
  2025-12-26 11:39 [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
  2026-01-05  6:08 ` Boqun Feng
  2026-01-12 16:30 ` Danilo Krummrich
@ 2026-01-12 17:06 ` Bjorn Helgaas
  2 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2026-01-12 17:06 UTC (permalink / raw)
  To: Boqun Feng
  Cc: Danilo Krummrich, Bjorn Helgaas, Miguel Ojeda, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Joel Fernandes, linux-pci, linux-kernel,
	rust-for-linux, Dirk Behme, FUJITA Tomonori, kernel test robot,
	Liang Jie, Drew Fustini, David Gow

On Fri, Dec 26, 2025 at 07:39:38PM +0800, Boqun Feng wrote:
> 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.
> 
> Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512220740.4Kexm4dW-lkp@intel.com/
> Reported-by: Liang Jie <liangjie@lixiang.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251222034415.1384223-1-buaajxlj@163.com/
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Reviewed-by: Drew Fustini <fustini@kernel.org>
> Reviewed-by: David Gow <davidgow@google.com>
> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
> Reviewed-by: Danilo Krummrich <dakr@kernel.org>
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>

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().

> ---
> 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/20251222034415.1384223-1-buaajxlj@163.com/
> 
>  include/linux/pci.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 864775651c6f..b5cc0c2b9906 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -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 */
> -- 
> 2.51.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-12 17:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-26 11:39 [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
2026-01-05  6:08 ` Boqun Feng
2026-01-12 16:30 ` Danilo Krummrich
2026-01-12 17:03   ` Miguel Ojeda
2026-01-12 17:06 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox