Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] usb: xhci: fix USB_XHCI_PCI depends
@ 2020-05-19  5:06 Vinod Koul
  2020-05-19  5:16 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Vinod Koul @ 2020-05-19  5:06 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman
  Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Christian Lamparter,
	linux-usb, linux-kernel, Anders Roxell, Arnd Bergmann

The xhci-pci-renesas module exports symbols for xhci-pci to load the
RAM/ROM on renesas xhci controllers. We had dependency which works
when both the modules are builtin or modules.

But if xhci-pci is inbuilt and xhci-pci-renesas in module, we get below
linker error:
drivers/usb/host/xhci-pci.o: In function `xhci_pci_remove':
drivers/usb/host/xhci-pci.c:411: undefined reference to `renesas_xhci_pci_exit'
drivers/usb/host/xhci-pci.o: In function `xhci_pci_probe':
drivers/usb/host/xhci-pci.c:345: undefined reference to `renesas_xhci_check_request_fw'

Fix this by adding USB_XHCI_PCI having depends on USB_XHCI_PCI_RENESAS
|| !USB_XHCI_PCI_RENESAS so that both can be either inbuilt or modules.

Reported-by: Anders Roxell <anders.roxell@linaro.org>
Fixes: a66d21d7dba8 ("usb: xhci: Add support for Renesas controller with memory")
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/usb/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index b5c542d6a1c5..92783d175b3f 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -40,11 +40,11 @@ config USB_XHCI_DBGCAP
 config USB_XHCI_PCI
 	tristate
 	depends on USB_PCI
+	depends on USB_XHCI_PCI_RENESAS || !USB_XHCI_PCI_RENESAS
 	default y
 
 config USB_XHCI_PCI_RENESAS
 	tristate "Support for additional Renesas xHCI controller with firwmare"
-	depends on USB_XHCI_PCI
 	---help---
 	  Say 'Y' to enable the support for the Renesas xHCI controller with
 	  firwmare. Make sure you have the firwmare for the device and
-- 
2.25.4


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

* Re: [PATCH] usb: xhci: fix USB_XHCI_PCI depends
  2020-05-19  5:06 [PATCH] usb: xhci: fix USB_XHCI_PCI depends Vinod Koul
@ 2020-05-19  5:16 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2020-05-19  5:16 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-arm-msm,
	Christian Lamparter, linux-usb, linux-kernel, Anders Roxell,
	Arnd Bergmann

On Mon 18 May 22:06 PDT 2020, Vinod Koul wrote:

> The xhci-pci-renesas module exports symbols for xhci-pci to load the
> RAM/ROM on renesas xhci controllers. We had dependency which works
> when both the modules are builtin or modules.
> 
> But if xhci-pci is inbuilt and xhci-pci-renesas in module, we get below
> linker error:
> drivers/usb/host/xhci-pci.o: In function `xhci_pci_remove':
> drivers/usb/host/xhci-pci.c:411: undefined reference to `renesas_xhci_pci_exit'
> drivers/usb/host/xhci-pci.o: In function `xhci_pci_probe':
> drivers/usb/host/xhci-pci.c:345: undefined reference to `renesas_xhci_check_request_fw'
> 
> Fix this by adding USB_XHCI_PCI having depends on USB_XHCI_PCI_RENESAS
> || !USB_XHCI_PCI_RENESAS so that both can be either inbuilt or modules.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> Reported-by: Anders Roxell <anders.roxell@linaro.org>
> Fixes: a66d21d7dba8 ("usb: xhci: Add support for Renesas controller with memory")
> Tested-by: Anders Roxell <anders.roxell@linaro.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  drivers/usb/host/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index b5c542d6a1c5..92783d175b3f 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -40,11 +40,11 @@ config USB_XHCI_DBGCAP
>  config USB_XHCI_PCI
>  	tristate
>  	depends on USB_PCI
> +	depends on USB_XHCI_PCI_RENESAS || !USB_XHCI_PCI_RENESAS
>  	default y
>  
>  config USB_XHCI_PCI_RENESAS
>  	tristate "Support for additional Renesas xHCI controller with firwmare"
> -	depends on USB_XHCI_PCI
>  	---help---
>  	  Say 'Y' to enable the support for the Renesas xHCI controller with
>  	  firwmare. Make sure you have the firwmare for the device and
> -- 
> 2.25.4
> 

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19  5:06 [PATCH] usb: xhci: fix USB_XHCI_PCI depends Vinod Koul
2020-05-19  5:16 ` Bjorn Andersson

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git