Re: [patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:38PM +0100, Thomas Gleixner wrote:
> What a zoo:
> 
>  PCI_MSI
>   select GENERIC_MSI_IRQ
> 
>  PCI_MSI_IRQ_DOMAIN
>   def_bool y
>   depends on PCI_MSI
>   select GENERIC_MSI_IRQ_DOMAIN
> 
> Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in turn selects
> GENERIC_MSI_IRQ_DOMAIN. So all the dependencies on PCI_MSI_IRQ_DOMAIN are
> just an indirection to PCI_MSI.
> 
> Match the reality and just admit that PCI_MSI requires
> GENERIC_MSI_IRQ_DOMAIN.
> 
> Signed-off-by: Thomas Gleixner 
> ---
>  arch/um/drivers/Kconfig |1 
>  arch/um/include/asm/pci.h   |2 -
>  arch/x86/Kconfig|1 
>  arch/x86/include/asm/pci.h  |4 +-
>  drivers/pci/Kconfig |8 +
>  drivers/pci/controller/Kconfig  |   30 +---
>  drivers/pci/controller/dwc/Kconfig  |   48 
> 
>  drivers/pci/controller/mobiveil/Kconfig |6 ++--
>  drivers/pci/msi/Makefile|2 -
>  drivers/pci/probe.c |2 -
>  include/linux/msi.h |   32 ++---
>  11 files changed, 56 insertions(+), 80 deletions(-)

Reviewed-by: Jason Gunthorpe 

Jason


Re: [patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:12, Bjorn Helgaas wrote:
> On Fri, Nov 11, 2022 at 02:54:38PM +0100, Thomas Gleixner wrote:
>> What a zoo:
>> 
>>  PCI_MSI
>>  select GENERIC_MSI_IRQ
>> 
>>  PCI_MSI_IRQ_DOMAIN
>>  def_bool y
>>  depends on PCI_MSI
>>  select GENERIC_MSI_IRQ_DOMAIN
>> 
>> Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in turn selects
>> GENERIC_MSI_IRQ_DOMAIN. So all the dependencies on PCI_MSI_IRQ_DOMAIN are
>> just an indirection to PCI_MSI.
>> 
>> Match the reality and just admit that PCI_MSI requires
>> GENERIC_MSI_IRQ_DOMAIN.
>> 
>> Signed-off-by: Thomas Gleixner 
>
> Acked-by: Bjorn Helgaas 
>
> Just FYI, this will conflict with my work-in-progress to add more
> COMPILE_TEST coverage:
>   
> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=72b5e7c401a1
>
> No *actual* conflicts, just textually next door, so should be sipmle
> to resolve.  Worst case I can postpone my patch until the next cycle.

Linus should be able to resolve that conflict :)


Re: [patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:38PM +0100, Thomas Gleixner wrote:
> What a zoo:
> 
>  PCI_MSI
>   select GENERIC_MSI_IRQ
> 
>  PCI_MSI_IRQ_DOMAIN
>   def_bool y
>   depends on PCI_MSI
>   select GENERIC_MSI_IRQ_DOMAIN
> 
> Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in turn selects
> GENERIC_MSI_IRQ_DOMAIN. So all the dependencies on PCI_MSI_IRQ_DOMAIN are
> just an indirection to PCI_MSI.
> 
> Match the reality and just admit that PCI_MSI requires
> GENERIC_MSI_IRQ_DOMAIN.
> 
> Signed-off-by: Thomas Gleixner 

Acked-by: Bjorn Helgaas 

Just FYI, this will conflict with my work-in-progress to add more
COMPILE_TEST coverage:
  
https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=72b5e7c401a1

No *actual* conflicts, just textually next door, so should be sipmle
to resolve.  Worst case I can postpone my patch until the next cycle.

> ---
>  arch/um/drivers/Kconfig |1 
>  arch/um/include/asm/pci.h   |2 -
>  arch/x86/Kconfig|1 
>  arch/x86/include/asm/pci.h  |4 +-
>  drivers/pci/Kconfig |8 +
>  drivers/pci/controller/Kconfig  |   30 +---
>  drivers/pci/controller/dwc/Kconfig  |   48 
> 
>  drivers/pci/controller/mobiveil/Kconfig |6 ++--
>  drivers/pci/msi/Makefile|2 -
>  drivers/pci/probe.c |2 -
>  include/linux/msi.h |   32 ++---
>  11 files changed, 56 insertions(+), 80 deletions(-)
> 
> --- a/arch/um/drivers/Kconfig
> +++ b/arch/um/drivers/Kconfig
> @@ -381,7 +381,6 @@ config UML_PCI_OVER_VIRTIO
>   select UML_IOMEM_EMULATION
>   select UML_DMA_EMULATION
>   select PCI_MSI
> - select PCI_MSI_IRQ_DOMAIN
>   select PCI_LOCKLESS_CONFIG
>  
>  config UML_PCI_OVER_VIRTIO_DEVICE_ID
> --- a/arch/um/include/asm/pci.h
> +++ b/arch/um/include/asm/pci.h
> @@ -7,7 +7,7 @@
>  /* Generic PCI */
>  #include 
>  
> -#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +#ifdef CONFIG_PCI_MSI
>  /*
>   * This is a bit of an annoying hack, and it assumes we only have
>   * the virt-pci (if anything). Which is true, but still.
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1109,7 +1109,6 @@ config X86_LOCAL_APIC
>   def_bool y
>   depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || 
> PCI_MSI
>   select IRQ_DOMAIN_HIERARCHY
> - select PCI_MSI_IRQ_DOMAIN if PCI_MSI
>  
>  config X86_IO_APIC
>   def_bool y
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -21,7 +21,7 @@ struct pci_sysdata {
>  #ifdef CONFIG_X86_64
>   void*iommu; /* IOMMU private data */
>  #endif
> -#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +#ifdef CONFIG_PCI_MSI
>   void*fwnode;/* IRQ domain for MSI assignment */
>  #endif
>  #if IS_ENABLED(CONFIG_VMD)
> @@ -52,7 +52,7 @@ static inline int pci_proc_domain(struct
>  }
>  #endif
>  
> -#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +#ifdef CONFIG_PCI_MSI
>  static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
>  {
>   return to_pci_sysdata(bus)->fwnode;
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -38,6 +38,7 @@ source "drivers/pci/pcie/Kconfig"
>  
>  config PCI_MSI
>   bool "Message Signaled Interrupts (MSI and MSI-X)"
> + select GENERIC_MSI_IRQ_DOMAIN
>   select GENERIC_MSI_IRQ
>   help
>  This allows device drivers to enable MSI (Message Signaled
> @@ -51,11 +52,6 @@ config PCI_MSI
>  
>  If you don't know what to do here, say Y.
>  
> -config PCI_MSI_IRQ_DOMAIN
> - def_bool y
> - depends on PCI_MSI
> - select GENERIC_MSI_IRQ_DOMAIN
> -
>  config PCI_MSI_ARCH_FALLBACKS
>   bool
>  
> @@ -192,7 +188,7 @@ config PCI_LABEL
>  
>  config PCI_HYPERV
>   tristate "Hyper-V PCI Frontend"
> - depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && 
> PCI_MSI_IRQ_DOMAIN && SYSFS
> + depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && SYSFS
>   select PCI_HYPERV_INTERFACE
>   help
> The PCI device frontend driver allows the kernel to import arbitrary
> --- a/drivers/pci/controller/Kconfig
> +++ b/drivers/pci/controller/Kconfig
> @@ -19,7 +19,7 @@ config PCI_AARDVARK
>   tristate "Aardvark PCIe controller"
>   depends on (ARCH_MVEBU && ARM64) || COMPILE_TEST
>   depends on OF
> - depends on PCI_MSI_IRQ_DOMAIN
> + depends on PCI_MSI
>   select PCI_BRIDGE_EMUL
>   help
>Add support for Aardvark 64bit PCIe Host Controller. This
> @@ -29,7 +29,7 @@ config PCI_AARDVARK
>  config PCIE_XILINX_NWL
>   bool "NWL PCIe Core"
>   depends on ARCH_ZYNQMP || COMPILE_TEST
> - depends on PCI_MSI_IRQ_DOMAIN
> + depends on PCI_MSI
>   help
>Say 'Y' here if you want kernel support for Xilinx
>NWL PCIe controller. The controller can act as Root Port
> @@ -53,7 

[patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-11 Thread Thomas Gleixner
What a zoo:

 PCI_MSI
select GENERIC_MSI_IRQ

 PCI_MSI_IRQ_DOMAIN
def_bool y
depends on PCI_MSI
select GENERIC_MSI_IRQ_DOMAIN

Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in turn selects
GENERIC_MSI_IRQ_DOMAIN. So all the dependencies on PCI_MSI_IRQ_DOMAIN are
just an indirection to PCI_MSI.

Match the reality and just admit that PCI_MSI requires
GENERIC_MSI_IRQ_DOMAIN.

Signed-off-by: Thomas Gleixner 
---
 arch/um/drivers/Kconfig |1 
 arch/um/include/asm/pci.h   |2 -
 arch/x86/Kconfig|1 
 arch/x86/include/asm/pci.h  |4 +-
 drivers/pci/Kconfig |8 +
 drivers/pci/controller/Kconfig  |   30 +---
 drivers/pci/controller/dwc/Kconfig  |   48 
 drivers/pci/controller/mobiveil/Kconfig |6 ++--
 drivers/pci/msi/Makefile|2 -
 drivers/pci/probe.c |2 -
 include/linux/msi.h |   32 ++---
 11 files changed, 56 insertions(+), 80 deletions(-)

--- a/arch/um/drivers/Kconfig
+++ b/arch/um/drivers/Kconfig
@@ -381,7 +381,6 @@ config UML_PCI_OVER_VIRTIO
select UML_IOMEM_EMULATION
select UML_DMA_EMULATION
select PCI_MSI
-   select PCI_MSI_IRQ_DOMAIN
select PCI_LOCKLESS_CONFIG
 
 config UML_PCI_OVER_VIRTIO_DEVICE_ID
--- a/arch/um/include/asm/pci.h
+++ b/arch/um/include/asm/pci.h
@@ -7,7 +7,7 @@
 /* Generic PCI */
 #include 
 
-#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+#ifdef CONFIG_PCI_MSI
 /*
  * This is a bit of an annoying hack, and it assumes we only have
  * the virt-pci (if anything). Which is true, but still.
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1109,7 +1109,6 @@ config X86_LOCAL_APIC
def_bool y
depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || 
PCI_MSI
select IRQ_DOMAIN_HIERARCHY
-   select PCI_MSI_IRQ_DOMAIN if PCI_MSI
 
 config X86_IO_APIC
def_bool y
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -21,7 +21,7 @@ struct pci_sysdata {
 #ifdef CONFIG_X86_64
void*iommu; /* IOMMU private data */
 #endif
-#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+#ifdef CONFIG_PCI_MSI
void*fwnode;/* IRQ domain for MSI assignment */
 #endif
 #if IS_ENABLED(CONFIG_VMD)
@@ -52,7 +52,7 @@ static inline int pci_proc_domain(struct
 }
 #endif
 
-#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+#ifdef CONFIG_PCI_MSI
 static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
 {
return to_pci_sysdata(bus)->fwnode;
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -38,6 +38,7 @@ source "drivers/pci/pcie/Kconfig"
 
 config PCI_MSI
bool "Message Signaled Interrupts (MSI and MSI-X)"
+   select GENERIC_MSI_IRQ_DOMAIN
select GENERIC_MSI_IRQ
help
   This allows device drivers to enable MSI (Message Signaled
@@ -51,11 +52,6 @@ config PCI_MSI
 
   If you don't know what to do here, say Y.
 
-config PCI_MSI_IRQ_DOMAIN
-   def_bool y
-   depends on PCI_MSI
-   select GENERIC_MSI_IRQ_DOMAIN
-
 config PCI_MSI_ARCH_FALLBACKS
bool
 
@@ -192,7 +188,7 @@ config PCI_LABEL
 
 config PCI_HYPERV
tristate "Hyper-V PCI Frontend"
-   depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && 
PCI_MSI_IRQ_DOMAIN && SYSFS
+   depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && SYSFS
select PCI_HYPERV_INTERFACE
help
  The PCI device frontend driver allows the kernel to import arbitrary
--- a/drivers/pci/controller/Kconfig
+++ b/drivers/pci/controller/Kconfig
@@ -19,7 +19,7 @@ config PCI_AARDVARK
tristate "Aardvark PCIe controller"
depends on (ARCH_MVEBU && ARM64) || COMPILE_TEST
depends on OF
-   depends on PCI_MSI_IRQ_DOMAIN
+   depends on PCI_MSI
select PCI_BRIDGE_EMUL
help
 Add support for Aardvark 64bit PCIe Host Controller. This
@@ -29,7 +29,7 @@ config PCI_AARDVARK
 config PCIE_XILINX_NWL
bool "NWL PCIe Core"
depends on ARCH_ZYNQMP || COMPILE_TEST
-   depends on PCI_MSI_IRQ_DOMAIN
+   depends on PCI_MSI
help
 Say 'Y' here if you want kernel support for Xilinx
 NWL PCIe controller. The controller can act as Root Port
@@ -53,7 +53,7 @@ config PCI_IXP4XX
 config PCI_TEGRA
bool "NVIDIA Tegra PCIe controller"
depends on ARCH_TEGRA || COMPILE_TEST
-   depends on PCI_MSI_IRQ_DOMAIN
+   depends on PCI_MSI
help
  Say Y here if you want support for the PCIe host controller found
  on NVIDIA Tegra SoCs.
@@ -70,7 +70,7 @@ config PCI_RCAR_GEN2
 config PCIE_RCAR_HOST
bool "Renesas R-Car PCIe host controller"
depends on ARCH_RENESAS || COMPILE_TEST
-   depends on PCI_MSI_IRQ_DOMAIN
+   depends on PCI_MSI
help
  Say Y here if you want PC