linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/MSI: Provide missing stub for pci_msix_can_alloc_dyn()
@ 2023-03-29 20:13 Reinette Chatre
  2023-03-29 21:08 ` Sathyanarayanan Kuppuswamy
  2023-04-06 18:48 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Reinette Chatre @ 2023-03-29 20:13 UTC (permalink / raw)
  To: bhelgaas, nathan, ndesaulniers, trix, tglx
  Cc: darwi, kevin.tian, reinette.chatre, linux-pci, linux-kernel, llvm

pci_msix_can_alloc_dyn() is not declared when CONFIG_PCI_MSI
is disabled.

There is no existing user of pci_msix_can_alloc_dyn() but
work is in progress to change this. This work encounters
the following error when CONFIG_PCI_MSI is disabled:

drivers/vfio/pci/vfio_pci_intrs.c:427:21: error: implicit declaration \
	of function 'pci_msix_can_alloc_dyn' \
	[-Werror=implicit-function-declaration]

Provide definition for pci_msix_can_alloc_dyn() in preparation
for users that need to compile when CONFIG_PCI_MSI is disabled.

Fixes: 34026364df8e ("PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303291000.PWFqGCxH-lkp@intel.com/
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
I missed this one in my previous fix. After this all the functions
in pci.h's #ifdef CONFIG_PCI_MSI portion have stubs when
CONFIG_PCI_MSI is disabled.

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

diff --git a/include/linux/pci.h b/include/linux/pci.h
index b50e5c79f7e3..a5dda515fcd1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1624,6 +1624,8 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 					      flags, NULL);
 }
 
+static inline bool pci_msix_can_alloc_dyn(struct pci_dev *dev)
+{ return false; }
 static inline struct msi_map pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
 						   const struct irq_affinity_desc *affdesc)
 {
-- 
2.34.1


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

* Re: [PATCH] PCI/MSI: Provide missing stub for pci_msix_can_alloc_dyn()
  2023-03-29 20:13 [PATCH] PCI/MSI: Provide missing stub for pci_msix_can_alloc_dyn() Reinette Chatre
@ 2023-03-29 21:08 ` Sathyanarayanan Kuppuswamy
  2023-04-06 18:48 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Sathyanarayanan Kuppuswamy @ 2023-03-29 21:08 UTC (permalink / raw)
  To: Reinette Chatre, bhelgaas, nathan, ndesaulniers, trix, tglx
  Cc: darwi, kevin.tian, linux-pci, linux-kernel, llvm

Hi,

On 3/29/23 1:13 PM, Reinette Chatre wrote:
> pci_msix_can_alloc_dyn() is not declared when CONFIG_PCI_MSI
> is disabled.
> 
> There is no existing user of pci_msix_can_alloc_dyn() but
> work is in progress to change this. This work encounters
> the following error when CONFIG_PCI_MSI is disabled:
> 
> drivers/vfio/pci/vfio_pci_intrs.c:427:21: error: implicit declaration \
> 	of function 'pci_msix_can_alloc_dyn' \
> 	[-Werror=implicit-function-declaration]
> 
> Provide definition for pci_msix_can_alloc_dyn() in preparation
> for users that need to compile when CONFIG_PCI_MSI is disabled.
> 
> Fixes: 34026364df8e ("PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X")
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202303291000.PWFqGCxH-lkp@intel.com/
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---

Looks good to me.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

> I missed this one in my previous fix. After this all the functions
> in pci.h's #ifdef CONFIG_PCI_MSI portion have stubs when
> CONFIG_PCI_MSI is disabled.
> 
>  include/linux/pci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index b50e5c79f7e3..a5dda515fcd1 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1624,6 +1624,8 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
>  					      flags, NULL);
>  }
>  
> +static inline bool pci_msix_can_alloc_dyn(struct pci_dev *dev)
> +{ return false; }
>  static inline struct msi_map pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
>  						   const struct irq_affinity_desc *affdesc)
>  {

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

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

* Re: [PATCH] PCI/MSI: Provide missing stub for pci_msix_can_alloc_dyn()
  2023-03-29 20:13 [PATCH] PCI/MSI: Provide missing stub for pci_msix_can_alloc_dyn() Reinette Chatre
  2023-03-29 21:08 ` Sathyanarayanan Kuppuswamy
@ 2023-04-06 18:48 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2023-04-06 18:48 UTC (permalink / raw)
  To: Reinette Chatre
  Cc: bhelgaas, nathan, ndesaulniers, trix, tglx, darwi, kevin.tian,
	linux-pci, linux-kernel, llvm, Arnd Bergmann, Dan Williams,
	Marc Zyngier, Ira Weiny, Shay Drory, Jacob Keller, Eli Cohen,
	Saeed Mahameed

[+cc folks from Arnd's similar patch]

On Wed, Mar 29, 2023 at 01:13:11PM -0700, Reinette Chatre wrote:
> pci_msix_can_alloc_dyn() is not declared when CONFIG_PCI_MSI
> is disabled.
> 
> There is no existing user of pci_msix_can_alloc_dyn() but
> work is in progress to change this. This work encounters
> the following error when CONFIG_PCI_MSI is disabled:
> 
> drivers/vfio/pci/vfio_pci_intrs.c:427:21: error: implicit declaration \
> 	of function 'pci_msix_can_alloc_dyn' \
> 	[-Werror=implicit-function-declaration]
> 
> Provide definition for pci_msix_can_alloc_dyn() in preparation
> for users that need to compile when CONFIG_PCI_MSI is disabled.
> 
> Fixes: 34026364df8e ("PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X")
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202303291000.PWFqGCxH-lkp@intel.com/
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>

Applied with Sathy's reviewed-by to for-linus for v6.3, thanks!

I also added the Fixes: line for mlx5 from Arnd's patch.

> ---
> I missed this one in my previous fix. After this all the functions
> in pci.h's #ifdef CONFIG_PCI_MSI portion have stubs when
> CONFIG_PCI_MSI is disabled.
> 
>  include/linux/pci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index b50e5c79f7e3..a5dda515fcd1 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1624,6 +1624,8 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
>  					      flags, NULL);
>  }
>  
> +static inline bool pci_msix_can_alloc_dyn(struct pci_dev *dev)
> +{ return false; }
>  static inline struct msi_map pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
>  						   const struct irq_affinity_desc *affdesc)
>  {
> -- 
> 2.34.1
> 

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

end of thread, other threads:[~2023-04-06 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29 20:13 [PATCH] PCI/MSI: Provide missing stub for pci_msix_can_alloc_dyn() Reinette Chatre
2023-03-29 21:08 ` Sathyanarayanan Kuppuswamy
2023-04-06 18:48 ` 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).