* [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
@ 2025-12-15 2:54 Boqun Feng
2025-12-16 9:13 ` Danilo Krummrich
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Boqun Feng @ 2025-12-15 2:54 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
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.
Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
---
I hit a build error without this:
../rust/helpers/pci.c:36:2: error: call to undeclared function 'pci_free_irq_vectors'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
36 | pci_free_irq_vectors(dev);
| ^
../rust/helpers/pci.c:36:2: note: did you mean 'pci_alloc_irq_vectors'?
../include/linux/pci.h:2208:1: note: 'pci_alloc_irq_vectors' declared here
2208 | pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
| ^
1 error generated.
when ./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch arm64 --kconfig_add CONFIG_RUST=y rust_doctests_kernel
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] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-15 2:54 [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
@ 2025-12-16 9:13 ` Danilo Krummrich
2025-12-18 5:03 ` Drew Fustini
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Danilo Krummrich @ 2025-12-16 9:13 UTC (permalink / raw)
To: Boqun Feng, Bjorn Helgaas
Cc: 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
On 12/15/25 3:54 AM, 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.
>
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Bjorn, I assume you will pick this up? Otherwise I can pick it up as well, I
will likely send a -fixes PR for -rc2 anyways.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-15 2:54 [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
2025-12-16 9:13 ` Danilo Krummrich
@ 2025-12-18 5:03 ` Drew Fustini
2025-12-19 8:33 ` David Gow
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Drew Fustini @ 2025-12-18 5:03 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
On Mon, Dec 15, 2025 at 11:54:44AM +0900, 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.
>
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> ---
> I hit a build error without this:
>
> ../rust/helpers/pci.c:36:2: error: call to undeclared function 'pci_free_irq_vectors'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 36 | pci_free_irq_vectors(dev);
> | ^
> ../rust/helpers/pci.c:36:2: note: did you mean 'pci_alloc_irq_vectors'?
> ../include/linux/pci.h:2208:1: note: 'pci_alloc_irq_vectors' declared here
> 2208 | pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> | ^
> 1 error generated.
>
> when ./tools/testing/kunit/kunit.py run --make_options LLVM=1 --arch arm64 --kconfig_add CONFIG_RUST=y rust_doctests_kernel
>
> 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
>
Reviewed-by: Drew Fustini <fustini@kernel.org>
Thanks for the fix. I ran into this when building next-20251217 for a
machine without PCIe and was happy to find this on lore.
Drew
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-15 2:54 [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
2025-12-16 9:13 ` Danilo Krummrich
2025-12-18 5:03 ` Drew Fustini
@ 2025-12-19 8:33 ` David Gow
2025-12-19 14:59 ` Joel Fernandes
2025-12-25 9:10 ` Miguel Ojeda
4 siblings, 0 replies; 10+ messages in thread
From: David Gow @ 2025-12-19 8:33 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
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
On Mon, 15 Dec 2025 at 10:55, Boqun Feng <boqun.feng@gmail.com> 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.
>
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> ---
Thanks very much!
Reviewed-by: David Gow <davidgow@google.com>
Cheers,
-- David
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5281 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-15 2:54 [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
` (2 preceding siblings ...)
2025-12-19 8:33 ` David Gow
@ 2025-12-19 14:59 ` Joel Fernandes
2025-12-25 9:10 ` Miguel Ojeda
4 siblings, 0 replies; 10+ messages in thread
From: Joel Fernandes @ 2025-12-19 14:59 UTC (permalink / raw)
To: Boqun Feng, Danilo Krummrich, Bjorn Helgaas, Miguel Ojeda
Cc: Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, linux-pci, linux-kernel, rust-for-linux
On 12/14/2025 9:54 PM, 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.
>
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-15 2:54 [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
` (3 preceding siblings ...)
2025-12-19 14:59 ` Joel Fernandes
@ 2025-12-25 9:10 ` Miguel Ojeda
2025-12-25 9:36 ` FUJITA Tomonori
2025-12-25 9:37 ` Boqun Feng
4 siblings, 2 replies; 10+ messages in thread
From: Miguel Ojeda @ 2025-12-25 9:10 UTC (permalink / raw)
To: Boqun Feng, FUJITA Tomonori
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
On Mon, Dec 15, 2025 at 3:54 AM Boqun Feng <boqun.feng@gmail.com> 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.
>
> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Related: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
I guess it counts as a report, so we may want a Reported-by (Cc'ing Tomo).
Cheers,
Miguel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-25 9:10 ` Miguel Ojeda
@ 2025-12-25 9:36 ` FUJITA Tomonori
2025-12-25 10:19 ` Boqun Feng
2025-12-25 9:37 ` Boqun Feng
1 sibling, 1 reply; 10+ messages in thread
From: FUJITA Tomonori @ 2025-12-25 9:36 UTC (permalink / raw)
To: miguel.ojeda.sandonis
Cc: boqun.feng, fujita.tomonori, dakr, bhelgaas, ojeda, gary,
bjorn3_gh, lossin, a.hindborg, aliceryhl, tmgross, joelagnelf,
linux-pci, linux-kernel, rust-for-linux
On Thu, 25 Dec 2025 10:10:04 +0100
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
> On Mon, Dec 15, 2025 at 3:54 AM Boqun Feng <boqun.feng@gmail.com> 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.
>>
>> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
>> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
>
> Related: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
>
> I guess it counts as a report, so we may want a Reported-by (Cc'ing Tomo).
Since pci.rs is only compiled when CONFIG_PCI is enabled. So it seems
consistent to treat the PCI helpers the same way. That said, this
approach is also fine by me: it's already inconsistent that
pci_alloc_irq_vectors() has a stuf definition, while
pci_free_irq_vectors does not.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-25 9:10 ` Miguel Ojeda
2025-12-25 9:36 ` FUJITA Tomonori
@ 2025-12-25 9:37 ` Boqun Feng
1 sibling, 0 replies; 10+ messages in thread
From: Boqun Feng @ 2025-12-25 9:37 UTC (permalink / raw)
To: Miguel Ojeda
Cc: FUJITA Tomonori, 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
On Thu, Dec 25, 2025 at 10:10:04AM +0100, Miguel Ojeda wrote:
> On Mon, Dec 15, 2025 at 3:54 AM Boqun Feng <boqun.feng@gmail.com> 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.
> >
> > Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> > Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
>
> Related: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
>
Thanks! I was missing that, and I should have replied Tomo's patch.
> I guess it counts as a report, so we may want a Reported-by (Cc'ing Tomo).
>
Tomo, how do you feel about two fix approaches? I think providing dummy
pci_free_irq_vectors() is better because it's easier and aligned with
other pci_*() APIs.
Regards,
Boqun
> Cheers,
> Miguel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-25 9:36 ` FUJITA Tomonori
@ 2025-12-25 10:19 ` Boqun Feng
2025-12-26 11:11 ` FUJITA Tomonori
0 siblings, 1 reply; 10+ messages in thread
From: Boqun Feng @ 2025-12-25 10:19 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: miguel.ojeda.sandonis, dakr, bhelgaas, ojeda, gary, bjorn3_gh,
lossin, a.hindborg, aliceryhl, tmgross, joelagnelf, linux-pci,
linux-kernel, rust-for-linux, Liang Jie
On Thu, Dec 25, 2025 at 06:36:31PM +0900, FUJITA Tomonori wrote:
> On Thu, 25 Dec 2025 10:10:04 +0100
> Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
>
> > On Mon, Dec 15, 2025 at 3:54 AM Boqun Feng <boqun.feng@gmail.com> 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.
> >>
> >> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
> >> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> >
> > Related: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
> >
> > I guess it counts as a report, so we may want a Reported-by (Cc'ing Tomo).
>
> Since pci.rs is only compiled when CONFIG_PCI is enabled. So it seems
> consistent to treat the PCI helpers the same way. That said, this
> approach is also fine by me: it's already inconsistent that
> pci_alloc_irq_vectors() has a stuf definition, while
> pci_free_irq_vectors does not.
Yes, I think providing a stub pci_free_irq_vectors() is the way to go.
If you are OK with it, I could send a v2 with your and Liang Jie's
Reported-by. Alternatively, since you're the first one sending the fix,
and I would have replied that with the suggestion if I didn't miss that,
feel free to send a v2 (providing the stub pci_free_irq_vectors()) from
you ;-)
Regards,
Boqun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n
2025-12-25 10:19 ` Boqun Feng
@ 2025-12-26 11:11 ` FUJITA Tomonori
0 siblings, 0 replies; 10+ messages in thread
From: FUJITA Tomonori @ 2025-12-26 11:11 UTC (permalink / raw)
To: boqun.feng
Cc: fujita.tomonori, miguel.ojeda.sandonis, dakr, bhelgaas, ojeda,
gary, bjorn3_gh, lossin, a.hindborg, aliceryhl, tmgross,
joelagnelf, linux-pci, linux-kernel, rust-for-linux, buaajxlj
On Thu, 25 Dec 2025 18:19:08 +0800
Boqun Feng <boqun.feng@gmail.com> wrote:
> On Thu, Dec 25, 2025 at 06:36:31PM +0900, FUJITA Tomonori wrote:
>> On Thu, 25 Dec 2025 10:10:04 +0100
>> Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
>>
>> > On Mon, Dec 15, 2025 at 3:54 AM Boqun Feng <boqun.feng@gmail.com> 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.
>> >>
>> >> Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
>> >> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
>> >
>> > Related: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
>> >
>> > I guess it counts as a report, so we may want a Reported-by (Cc'ing Tomo).
>>
>> Since pci.rs is only compiled when CONFIG_PCI is enabled. So it seems
>> consistent to treat the PCI helpers the same way. That said, this
>> approach is also fine by me: it's already inconsistent that
>> pci_alloc_irq_vectors() has a stuf definition, while
>> pci_free_irq_vectors does not.
>
> Yes, I think providing a stub pci_free_irq_vectors() is the way to go.
> If you are OK with it, I could send a v2 with your and Liang Jie's
> Reported-by.
It works for me. Please go ahead.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-12-26 11:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-15 2:54 [PATCH] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n Boqun Feng
2025-12-16 9:13 ` Danilo Krummrich
2025-12-18 5:03 ` Drew Fustini
2025-12-19 8:33 ` David Gow
2025-12-19 14:59 ` Joel Fernandes
2025-12-25 9:10 ` Miguel Ojeda
2025-12-25 9:36 ` FUJITA Tomonori
2025-12-25 10:19 ` Boqun Feng
2025-12-26 11:11 ` FUJITA Tomonori
2025-12-25 9:37 ` Boqun Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).