* [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
@ 2023-02-09 21:49 Reinette Chatre
2023-02-10 5:12 ` Tian, Kevin
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Reinette Chatre @ 2023-02-09 21:49 UTC (permalink / raw)
To: bhelgaas, nathan, ndesaulniers, trix
Cc: linux-pci, linux-kernel, llvm, tglx, kevin.tian, darwi, reinette.chatre
pci_msix_alloc_irq_at() and pci_msix_free_irq() are not
declared when CONFIG_PCI_MSI is disabled.
Users of these two calls do not yet exist but when users
do appear (shown below is an attempt to use the new API
in vfio-pci) the following errors will be encountered when
compiling with CONFIG_PCI_MSI disabled:
drivers/vfio/pci/vfio_pci_intrs.c:461:4: error: implicit declaration of\
function 'pci_msix_free_irq' is invalid in C99\
[-Werror,-Wimplicit-function-declaration]
pci_msix_free_irq(pdev, msix_map);
^
drivers/vfio/pci/vfio_pci_intrs.c:461:4: note: did you mean 'pci_ims_free_irq'?
include/linux/pci.h:2516:6: note: 'pci_ims_free_irq' declared here
void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
^
drivers/vfio/pci/vfio_pci_intrs.c:511:15: error: implicit declaration of\
function 'pci_msix_alloc_irq_at' is invalid in C99\
[-Werror,-Wimplicit-function-declaration]
msix_map = pci_msix_alloc_irq_at(pdev, vector, NULL);
^
drivers/vfio/pci/vfio_pci_intrs.c:511:15: note: did you mean 'pci_ims_alloc_irq'?
include/linux/pci.h:2514:16: note: 'pci_ims_alloc_irq' declared here
struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,\
union msi_instance_cookie *icookie,
Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in
preparation for users that need to compile when CONFIG_PCI_MSI is
disabled.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
checkpatch.pl warns about the usage of -ENOSYS but it does appear
to be the custom.
include/linux/pci.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index adffd65e84b4..448482d1c4fe 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1621,6 +1621,19 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
flags, NULL);
}
+static inline struct msi_map
+pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
+ const struct irq_affinity_desc *affdesc)
+{
+ struct msi_map map = { .index = -ENOSYS };
+
+ return map;
+}
+
+static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
+{
+}
+
static inline void pci_free_irq_vectors(struct pci_dev *dev)
{
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-09 21:49 [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled Reinette Chatre
@ 2023-02-10 5:12 ` Tian, Kevin
2023-02-10 20:45 ` ALOK TIWARI
2023-02-14 22:24 ` Bjorn Helgaas
2 siblings, 0 replies; 10+ messages in thread
From: Tian, Kevin @ 2023-02-10 5:12 UTC (permalink / raw)
To: Chatre, Reinette, bhelgaas, nathan, ndesaulniers, Rix, Tom
Cc: linux-pci, linux-kernel, llvm, tglx, darwi
> From: Chatre, Reinette <reinette.chatre@intel.com>
> Sent: Friday, February 10, 2023 5:49 AM
>
> pci_msix_alloc_irq_at() and pci_msix_free_irq() are not
> declared when CONFIG_PCI_MSI is disabled.
>
> Users of these two calls do not yet exist but when users
> do appear (shown below is an attempt to use the new API
> in vfio-pci) the following errors will be encountered when
> compiling with CONFIG_PCI_MSI disabled:
> drivers/vfio/pci/vfio_pci_intrs.c:461:4: error: implicit declaration of\
> function 'pci_msix_free_irq' is invalid in C99\
> [-Werror,-Wimplicit-function-declaration]
> pci_msix_free_irq(pdev, msix_map);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:461:4: note: did you mean
> 'pci_ims_free_irq'?
> include/linux/pci.h:2516:6: note: 'pci_ims_free_irq' declared here
> void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:511:15: error: implicit declaration of\
> function 'pci_msix_alloc_irq_at' is invalid in C99\
> [-Werror,-Wimplicit-function-declaration]
> msix_map = pci_msix_alloc_irq_at(pdev, vector, NULL);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:511:15: note: did you mean
> 'pci_ims_alloc_irq'?
> include/linux/pci.h:2514:16: note: 'pci_ims_alloc_irq' declared here
> struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,\
> union msi_instance_cookie *icookie,
>
> Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in
> preparation for users that need to compile when CONFIG_PCI_MSI is
> disabled.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-09 21:49 [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled Reinette Chatre
2023-02-10 5:12 ` Tian, Kevin
@ 2023-02-10 20:45 ` ALOK TIWARI
2023-02-10 21:12 ` Reinette Chatre
2023-02-14 22:24 ` Bjorn Helgaas
2 siblings, 1 reply; 10+ messages in thread
From: ALOK TIWARI @ 2023-02-10 20:45 UTC (permalink / raw)
To: Reinette Chatre, bhelgaas, nathan, ndesaulniers, trix
Cc: linux-pci, linux-kernel, llvm, tglx, kevin.tian, darwi
shall we need to define this function under -> #ifndef CONFIG_PCI_MSI
#ifndef CONFIG_PCI_MSI
+static inline struct msi_map
+pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
+ const struct irq_affinity_desc *affdesc)
+{
+ struct msi_map map = { .index = -ENOSYS };
+
+ return map;
+}
+
+static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
+{
+}
+#endif
Thanks,
Alok
On 2/10/2023 3:19 AM, Reinette Chatre wrote:
> pci_msix_alloc_irq_at() and pci_msix_free_irq() are not
> declared when CONFIG_PCI_MSI is disabled.
>
> Users of these two calls do not yet exist but when users
> do appear (shown below is an attempt to use the new API
> in vfio-pci) the following errors will be encountered when
> compiling with CONFIG_PCI_MSI disabled:
> drivers/vfio/pci/vfio_pci_intrs.c:461:4: error: implicit declaration of\
> function 'pci_msix_free_irq' is invalid in C99\
> [-Werror,-Wimplicit-function-declaration]
> pci_msix_free_irq(pdev, msix_map);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:461:4: note: did you mean 'pci_ims_free_irq'?
> include/linux/pci.h:2516:6: note: 'pci_ims_free_irq' declared here
> void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:511:15: error: implicit declaration of\
> function 'pci_msix_alloc_irq_at' is invalid in C99\
> [-Werror,-Wimplicit-function-declaration]
> msix_map = pci_msix_alloc_irq_at(pdev, vector, NULL);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:511:15: note: did you mean 'pci_ims_alloc_irq'?
> include/linux/pci.h:2514:16: note: 'pci_ims_alloc_irq' declared here
> struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,\
> union msi_instance_cookie *icookie,
>
> Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in
> preparation for users that need to compile when CONFIG_PCI_MSI is
> disabled.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
>
> checkpatch.pl warns about the usage of -ENOSYS but it does appear
> to be the custom.
>
> include/linux/pci.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index adffd65e84b4..448482d1c4fe 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1621,6 +1621,19 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> flags, NULL);
> }
>
> +static inline struct msi_map
> +pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
> + const struct irq_affinity_desc *affdesc)
> +{
> + struct msi_map map = { .index = -ENOSYS };
> +
> + return map;
> +}
> +
> +static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
> +{
> +}
> +
> static inline void pci_free_irq_vectors(struct pci_dev *dev)
> {
> }
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-10 20:45 ` ALOK TIWARI
@ 2023-02-10 21:12 ` Reinette Chatre
2023-02-11 5:05 ` [External] : " ALOK TIWARI
0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2023-02-10 21:12 UTC (permalink / raw)
To: ALOK TIWARI, bhelgaas, nathan, ndesaulniers, trix
Cc: linux-pci, linux-kernel, llvm, tglx, kevin.tian, darwi
Hi Alok,
On 2/10/2023 12:45 PM, ALOK TIWARI wrote:
> shall we need to define this function under -> #ifndef CONFIG_PCI_MSI
>
> #ifndef CONFIG_PCI_MSI
>
> +static inline struct msi_map
> +pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
> + const struct irq_affinity_desc *affdesc)
> +{
> + struct msi_map map = { .index = -ENOSYS };
> +
> + return map;
> +}
> +
> +static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
> +{
> +}
> +#endif
No need. include/linux/pci.h already has those definitions.
include/linux/pci.h already has:
#ifdef CONFIG_PCI_MSI
...
#else
...
/* new function definitions will be inserted here */
...
#endif
Reinette
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-10 21:12 ` Reinette Chatre
@ 2023-02-11 5:05 ` ALOK TIWARI
2023-02-13 18:46 ` Thomas Gleixner
0 siblings, 1 reply; 10+ messages in thread
From: ALOK TIWARI @ 2023-02-11 5:05 UTC (permalink / raw)
To: Reinette Chatre, bhelgaas, nathan, ndesaulniers, trix
Cc: linux-pci, linux-kernel, llvm, tglx, kevin.tian, darwi
if, new function going to part of #else case . that is absolutely fine.
but that is not present in given PATCH.
Thanks,
Alok
On 2/11/2023 2:42 AM, Reinette Chatre wrote:
> Hi Alok,
>
> On 2/10/2023 12:45 PM, ALOK TIWARI wrote:
>> shall we need to define this function under -> #ifndef CONFIG_PCI_MSI
>>
>> #ifndef CONFIG_PCI_MSI
>>
>> +static inline struct msi_map
>> +pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
>> + const struct irq_affinity_desc *affdesc)
>> +{
>> + struct msi_map map = { .index = -ENOSYS };
>> +
>> + return map;
>> +}
>> +
>> +static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
>> +{
>> +}
>> +#endif
> No need. include/linux/pci.h already has those definitions.
>
> include/linux/pci.h already has:
>
> #ifdef CONFIG_PCI_MSI
>
> ...
>
> #else
>
> ...
> /* new function definitions will be inserted here */
> ...
>
> #endif
>
>
> Reinette
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-11 5:05 ` [External] : " ALOK TIWARI
@ 2023-02-13 18:46 ` Thomas Gleixner
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2023-02-13 18:46 UTC (permalink / raw)
To: ALOK TIWARI, Reinette Chatre, bhelgaas, nathan, ndesaulniers, trix
Cc: linux-pci, linux-kernel, llvm, kevin.tian, darwi
Alok!
On Sat, Feb 11 2023 at 10:35, ALOK TIWARI wrote:
Please do not top-post and trim your replies.
https://people.kernel.org/tglx/notes-about-netiquette
> if, new function going to part of #else case . that is absolutely fine.
> but that is not present in given PATCH.
Care to apply the patch and look where the stub functions are placed
instead of making uninformed claims?
Thanks,
tglx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-09 21:49 [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled Reinette Chatre
2023-02-10 5:12 ` Tian, Kevin
2023-02-10 20:45 ` ALOK TIWARI
@ 2023-02-14 22:24 ` Bjorn Helgaas
2023-02-14 22:44 ` Reinette Chatre
2023-02-14 23:02 ` Thomas Gleixner
2 siblings, 2 replies; 10+ messages in thread
From: Bjorn Helgaas @ 2023-02-14 22:24 UTC (permalink / raw)
To: Reinette Chatre
Cc: bhelgaas, nathan, ndesaulniers, trix, linux-pci, linux-kernel,
llvm, tglx, kevin.tian, darwi
On Thu, Feb 09, 2023 at 01:49:00PM -0800, Reinette Chatre wrote:
> pci_msix_alloc_irq_at() and pci_msix_free_irq() are not
> declared when CONFIG_PCI_MSI is disabled.
>
> Users of these two calls do not yet exist but when users
> do appear (shown below is an attempt to use the new API
> in vfio-pci) the following errors will be encountered when
> compiling with CONFIG_PCI_MSI disabled:
> drivers/vfio/pci/vfio_pci_intrs.c:461:4: error: implicit declaration of\
> function 'pci_msix_free_irq' is invalid in C99\
> [-Werror,-Wimplicit-function-declaration]
> pci_msix_free_irq(pdev, msix_map);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:461:4: note: did you mean 'pci_ims_free_irq'?
> include/linux/pci.h:2516:6: note: 'pci_ims_free_irq' declared here
> void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:511:15: error: implicit declaration of\
> function 'pci_msix_alloc_irq_at' is invalid in C99\
> [-Werror,-Wimplicit-function-declaration]
> msix_map = pci_msix_alloc_irq_at(pdev, vector, NULL);
> ^
> drivers/vfio/pci/vfio_pci_intrs.c:511:15: note: did you mean 'pci_ims_alloc_irq'?
> include/linux/pci.h:2514:16: note: 'pci_ims_alloc_irq' declared here
> struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,\
> union msi_instance_cookie *icookie,
>
> Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in
> preparation for users that need to compile when CONFIG_PCI_MSI is
> disabled.
I think this should have a "Fixes:" tag to connect it with the commit
that added pci_msix_alloc_irq_at() and pci_msix_free_irq().
Looks like 34026364df8e ("PCI/MSI: Provide post-enable dynamic
allocation interfaces for MSI-X").
Thomas merged 34026364df8e, so it would be best if he took the fixup
as well.
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
>
> checkpatch.pl warns about the usage of -ENOSYS but it does appear
> to be the custom.
>
> include/linux/pci.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index adffd65e84b4..448482d1c4fe 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1621,6 +1621,19 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> flags, NULL);
> }
>
> +static inline struct msi_map
> +pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
> + const struct irq_affinity_desc *affdesc)
> +{
> + struct msi_map map = { .index = -ENOSYS };
> +
> + return map;
> +}
> +
> +static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
> +{
> +}
> +
> static inline void pci_free_irq_vectors(struct pci_dev *dev)
> {
> }
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-14 22:24 ` Bjorn Helgaas
@ 2023-02-14 22:44 ` Reinette Chatre
2023-02-14 23:02 ` Thomas Gleixner
1 sibling, 0 replies; 10+ messages in thread
From: Reinette Chatre @ 2023-02-14 22:44 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: bhelgaas, nathan, ndesaulniers, trix, linux-pci, linux-kernel,
llvm, tglx, kevin.tian, darwi
Hi Bjorn,
On 2/14/2023 2:24 PM, Bjorn Helgaas wrote:
> I think this should have a "Fixes:" tag to connect it with the commit
> that added pci_msix_alloc_irq_at() and pci_msix_free_irq().
>
Thank you. I was not sure if a Fixes tag was needed since it does not
fix an existing issue but instead prevents a future issue.
> Looks like 34026364df8e ("PCI/MSI: Provide post-enable dynamic
> allocation interfaces for MSI-X").
>
Correct.
> Thomas merged 34026364df8e, so it would be best if he took the fixup
> as well.
Thomas did pick this up in tip's irq/urgent branch. While doing so he
added the Fixes tag that you proposed and also improved the subject.
Thank you very much
Reinette
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-14 22:24 ` Bjorn Helgaas
2023-02-14 22:44 ` Reinette Chatre
@ 2023-02-14 23:02 ` Thomas Gleixner
2023-02-14 23:14 ` Bjorn Helgaas
1 sibling, 1 reply; 10+ messages in thread
From: Thomas Gleixner @ 2023-02-14 23:02 UTC (permalink / raw)
To: Bjorn Helgaas, Reinette Chatre
Cc: bhelgaas, nathan, ndesaulniers, trix, linux-pci, linux-kernel,
llvm, kevin.tian, darwi
On Tue, Feb 14 2023 at 16:24, Bjorn Helgaas wrote:
>> Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in
>> preparation for users that need to compile when CONFIG_PCI_MSI is
>> disabled.
>
> I think this should have a "Fixes:" tag to connect it with the commit
> that added pci_msix_alloc_irq_at() and pci_msix_free_irq().
>
> Looks like 34026364df8e ("PCI/MSI: Provide post-enable dynamic
> allocation interfaces for MSI-X").
>
> Thomas merged 34026364df8e, so it would be best if he took the fixup
> as well.
I did and miserably failed to Cc you on the notification. Sorry about that.
https://lore.kernel.org/r/167628749774.4906.17069524905880641563.tip-bot2@tip-bot2
Thanks,
tglx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled
2023-02-14 23:02 ` Thomas Gleixner
@ 2023-02-14 23:14 ` Bjorn Helgaas
0 siblings, 0 replies; 10+ messages in thread
From: Bjorn Helgaas @ 2023-02-14 23:14 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Reinette Chatre, bhelgaas, nathan, ndesaulniers, trix, linux-pci,
linux-kernel, llvm, kevin.tian, darwi
On Wed, Feb 15, 2023 at 12:02:17AM +0100, Thomas Gleixner wrote:
> On Tue, Feb 14 2023 at 16:24, Bjorn Helgaas wrote:
> >> Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in
> >> preparation for users that need to compile when CONFIG_PCI_MSI is
> >> disabled.
> >
> > I think this should have a "Fixes:" tag to connect it with the commit
> > that added pci_msix_alloc_irq_at() and pci_msix_free_irq().
> >
> > Looks like 34026364df8e ("PCI/MSI: Provide post-enable dynamic
> > allocation interfaces for MSI-X").
> >
> > Thomas merged 34026364df8e, so it would be best if he took the fixup
> > as well.
>
> I did and miserably failed to Cc you on the notification. Sorry about that.
>
> https://lore.kernel.org/r/167628749774.4906.17069524905880641563.tip-bot2@tip-bot2
No worries, thank you!
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-02-14 23:14 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-09 21:49 [PATCH] PCI: Fix build error when CONFIG_PCI_MSI disabled Reinette Chatre
2023-02-10 5:12 ` Tian, Kevin
2023-02-10 20:45 ` ALOK TIWARI
2023-02-10 21:12 ` Reinette Chatre
2023-02-11 5:05 ` [External] : " ALOK TIWARI
2023-02-13 18:46 ` Thomas Gleixner
2023-02-14 22:24 ` Bjorn Helgaas
2023-02-14 22:44 ` Reinette Chatre
2023-02-14 23:02 ` Thomas Gleixner
2023-02-14 23:14 ` Bjorn Helgaas
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).