linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: iproc: fix msi driver selection
@ 2015-12-18 14:57 Arnd Bergmann
  2015-12-18 17:23 ` Ray Jui
  2016-01-07  0:10 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2015-12-18 14:57 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, Ray Jui, Vikram Prakash, Anup Patel, Scott Branden,
	Marc Zyngier, linux-kernel, linux-arm-kernel

The newly added MSI support for iproc causes a link error when its
Kconfig option is disabled:

ERROR: "iproc_msi_exit" [drivers/pci/host/pcie-iproc.ko] undefined!
ERROR: "iproc_msi_init" [drivers/pci/host/pcie-iproc.ko] undefined!

This changes the header file so we use stub functions whenever
the driver is not built, even when CONFIG_MSI is enabled.

As the Kconfig logic for the driver is a bit off, I'm rectifying
that as well, by making it depend on the specific drivers that
call into the driver, and moving the option behind those instead
of before them.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 610894347cbf ("PCI: iproc: Add iProc PCIe MSI support")
---
Found on ARM randconfig builds a couple of days ago

diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
index 490476e172fd..d7c05894af70 100644
--- a/drivers/pci/host/Kconfig
+++ b/drivers/pci/host/Kconfig
@@ -124,15 +124,6 @@ config PCIE_IPROC
 	  iProc family of SoCs. An appropriate bus interface driver needs
 	  to be enabled to select this.
 
-config PCIE_IPROC_MSI
-	bool "Broadcom iProc PCIe MSI support"
-	depends on ARCH_BCM_IPROC && PCI_MSI
-	select PCI_MSI_IRQ_DOMAIN
-	default ARCH_BCM_IPROC
-	help
-	  Say Y here if you want to enable MSI support for Broadcom's iProc
-	  PCIe controller
-
 config PCIE_IPROC_PLATFORM
 	tristate "Broadcom iProc PCIe platform bus driver"
 	depends on ARCH_BCM_IPROC || (ARM && COMPILE_TEST)
@@ -154,6 +145,16 @@ config PCIE_IPROC_BCMA
 	  Say Y here if you want to use the Broadcom iProc PCIe controller
 	  through the BCMA bus interface
 
+config PCIE_IPROC_MSI
+	bool "Broadcom iProc PCIe MSI support"
+	depends on PCIE_IPROC_PLATFORM || PCIE_IPROC_BCMA
+	depends on PCI_MSI
+	select PCI_MSI_IRQ_DOMAIN
+	default ARCH_BCM_IPROC
+	help
+	  Say Y here if you want to enable MSI support for Broadcom's iProc
+	  PCIe controller
+
 config PCIE_ALTERA
 	bool "Altera PCIe controller"
 	depends on ARM || NIOS2
diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h
index 6def23a7eb54..e84d93c53c7b 100644
--- a/drivers/pci/host/pcie-iproc.h
+++ b/drivers/pci/host/pcie-iproc.h
@@ -79,7 +79,7 @@ struct iproc_pcie {
 int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
 int iproc_pcie_remove(struct iproc_pcie *pcie);
 
-#ifdef CONFIG_PCI_MSI
+#ifdef CONFIG_PCIE_IPROC_MSI
 int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node);
 void iproc_msi_exit(struct iproc_pcie *pcie);
 #else


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

* Re: [PATCH] PCI: iproc: fix msi driver selection
  2015-12-18 14:57 [PATCH] PCI: iproc: fix msi driver selection Arnd Bergmann
@ 2015-12-18 17:23 ` Ray Jui
  2016-01-07  0:10 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Ray Jui @ 2015-12-18 17:23 UTC (permalink / raw)
  To: Arnd Bergmann, Bjorn Helgaas
  Cc: linux-pci, Vikram Prakash, Anup Patel, Scott Branden,
	Marc Zyngier, linux-kernel, linux-arm-kernel

Hi Arnd,

On 12/18/2015 6:57 AM, Arnd Bergmann wrote:
> The newly added MSI support for iproc causes a link error when its
> Kconfig option is disabled:
>
> ERROR: "iproc_msi_exit" [drivers/pci/host/pcie-iproc.ko] undefined!
> ERROR: "iproc_msi_init" [drivers/pci/host/pcie-iproc.ko] undefined!
>
> This changes the header file so we use stub functions whenever
> the driver is not built, even when CONFIG_MSI is enabled.
>
> As the Kconfig logic for the driver is a bit off, I'm rectifying
> that as well, by making it depend on the specific drivers that
> call into the driver, and moving the option behind those instead
> of before them.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 610894347cbf ("PCI: iproc: Add iProc PCIe MSI support")
> ---
> Found on ARM randconfig builds a couple of days ago
>
> diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
> index 490476e172fd..d7c05894af70 100644
> --- a/drivers/pci/host/Kconfig
> +++ b/drivers/pci/host/Kconfig
> @@ -124,15 +124,6 @@ config PCIE_IPROC
>   	  iProc family of SoCs. An appropriate bus interface driver needs
>   	  to be enabled to select this.
>

I was actually not aware of the change that makes PCIE_IPROC hidden and 
selected by the bus drivers. But I know, :)

> -config PCIE_IPROC_MSI
> -	bool "Broadcom iProc PCIe MSI support"
> -	depends on ARCH_BCM_IPROC && PCI_MSI
> -	select PCI_MSI_IRQ_DOMAIN
> -	default ARCH_BCM_IPROC
> -	help
> -	  Say Y here if you want to enable MSI support for Broadcom's iProc
> -	  PCIe controller
> -
>   config PCIE_IPROC_PLATFORM
>   	tristate "Broadcom iProc PCIe platform bus driver"
>   	depends on ARCH_BCM_IPROC || (ARM && COMPILE_TEST)
> @@ -154,6 +145,16 @@ config PCIE_IPROC_BCMA
>   	  Say Y here if you want to use the Broadcom iProc PCIe controller
>   	  through the BCMA bus interface
>
> +config PCIE_IPROC_MSI
> +	bool "Broadcom iProc PCIe MSI support"
> +	depends on PCIE_IPROC_PLATFORM || PCIE_IPROC_BCMA
> +	depends on PCI_MSI
> +	select PCI_MSI_IRQ_DOMAIN
> +	default ARCH_BCM_IPROC
> +	help
> +	  Say Y here if you want to enable MSI support for Broadcom's iProc
> +	  PCIe controller
> +
>   config PCIE_ALTERA
>   	bool "Altera PCIe controller"
>   	depends on ARM || NIOS2
> diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h
> index 6def23a7eb54..e84d93c53c7b 100644
> --- a/drivers/pci/host/pcie-iproc.h
> +++ b/drivers/pci/host/pcie-iproc.h
> @@ -79,7 +79,7 @@ struct iproc_pcie {
>   int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
>   int iproc_pcie_remove(struct iproc_pcie *pcie);
>
> -#ifdef CONFIG_PCI_MSI
> +#ifdef CONFIG_PCIE_IPROC_MSI
>   int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node);
>   void iproc_msi_exit(struct iproc_pcie *pcie);
>   #else
>
>

This fix looks good to me. Thanks!

Reviewed-by: Ray Jui <rjui@broadcom.com>

Ray

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

* Re: [PATCH] PCI: iproc: fix msi driver selection
  2015-12-18 14:57 [PATCH] PCI: iproc: fix msi driver selection Arnd Bergmann
  2015-12-18 17:23 ` Ray Jui
@ 2016-01-07  0:10 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2016-01-07  0:10 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bjorn Helgaas, linux-pci, Ray Jui, Vikram Prakash, Anup Patel,
	Scott Branden, Marc Zyngier, linux-kernel, linux-arm-kernel

On Fri, Dec 18, 2015 at 03:57:53PM +0100, Arnd Bergmann wrote:
> The newly added MSI support for iproc causes a link error when its
> Kconfig option is disabled:
> 
> ERROR: "iproc_msi_exit" [drivers/pci/host/pcie-iproc.ko] undefined!
> ERROR: "iproc_msi_init" [drivers/pci/host/pcie-iproc.ko] undefined!
> 
> This changes the header file so we use stub functions whenever
> the driver is not built, even when CONFIG_MSI is enabled.
> 
> As the Kconfig logic for the driver is a bit off, I'm rectifying
> that as well, by making it depend on the specific drivers that
> call into the driver, and moving the option behind those instead
> of before them.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 610894347cbf ("PCI: iproc: Add iProc PCIe MSI support")

Applied with Ray's Reviewed-by to pci/host-iproc for v4.5, thanks!

Actually, since 610894347cbf hasn't been merged upstream yet, I just
squashed this fix into it and updated "pci/host-iproc" and "next".

> ---
> Found on ARM randconfig builds a couple of days ago
> 
> diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
> index 490476e172fd..d7c05894af70 100644
> --- a/drivers/pci/host/Kconfig
> +++ b/drivers/pci/host/Kconfig
> @@ -124,15 +124,6 @@ config PCIE_IPROC
>  	  iProc family of SoCs. An appropriate bus interface driver needs
>  	  to be enabled to select this.
>  
> -config PCIE_IPROC_MSI
> -	bool "Broadcom iProc PCIe MSI support"
> -	depends on ARCH_BCM_IPROC && PCI_MSI
> -	select PCI_MSI_IRQ_DOMAIN
> -	default ARCH_BCM_IPROC
> -	help
> -	  Say Y here if you want to enable MSI support for Broadcom's iProc
> -	  PCIe controller
> -
>  config PCIE_IPROC_PLATFORM
>  	tristate "Broadcom iProc PCIe platform bus driver"
>  	depends on ARCH_BCM_IPROC || (ARM && COMPILE_TEST)
> @@ -154,6 +145,16 @@ config PCIE_IPROC_BCMA
>  	  Say Y here if you want to use the Broadcom iProc PCIe controller
>  	  through the BCMA bus interface
>  
> +config PCIE_IPROC_MSI
> +	bool "Broadcom iProc PCIe MSI support"
> +	depends on PCIE_IPROC_PLATFORM || PCIE_IPROC_BCMA
> +	depends on PCI_MSI
> +	select PCI_MSI_IRQ_DOMAIN
> +	default ARCH_BCM_IPROC
> +	help
> +	  Say Y here if you want to enable MSI support for Broadcom's iProc
> +	  PCIe controller
> +
>  config PCIE_ALTERA
>  	bool "Altera PCIe controller"
>  	depends on ARM || NIOS2
> diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h
> index 6def23a7eb54..e84d93c53c7b 100644
> --- a/drivers/pci/host/pcie-iproc.h
> +++ b/drivers/pci/host/pcie-iproc.h
> @@ -79,7 +79,7 @@ struct iproc_pcie {
>  int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
>  int iproc_pcie_remove(struct iproc_pcie *pcie);
>  
> -#ifdef CONFIG_PCI_MSI
> +#ifdef CONFIG_PCIE_IPROC_MSI
>  int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node);
>  void iproc_msi_exit(struct iproc_pcie *pcie);
>  #else
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-01-07  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-18 14:57 [PATCH] PCI: iproc: fix msi driver selection Arnd Bergmann
2015-12-18 17:23 ` Ray Jui
2016-01-07  0:10 ` 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).