All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: qcom: fix glink dependencies
@ 2021-02-04 15:40 Arnd Bergmann
  2021-02-04 16:16 ` Alex Elder
  2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2021-02-04 15:40 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier, Alex Elder,
	Chris Lew, Rishabh Bhatnagar
  Cc: Arnd Bergmann, Suman Anna, Andrew F. Davis, Alexandre Courbot,
	Siddharth Gupta, Paul Cercueil, Colin Ian King, linux-remoteproc,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building the remoteproc drivers into the kernel while the qcom_glink
code is in a loadable module results in a link error:

ld.lld: error: undefined symbol: qcom_glink_ssr_notify
>>> referenced by vmlinux.o:(glink_subdev_unprepare)

Add a Kconfig dependency to avoid this.

Fixes: 8527efc59d45 ("rpmsg: glink: Guard qcom_glink_ssr_notify() with correct config")
Fixes: 5d1f2e3c8090 ("soc: qcom: glink_ssr: Internalize ssr_notifiers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/remoteproc/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index 9e7efe542f69..88488af01fd9 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -155,6 +155,7 @@ config QCOM_Q6V5_ADSP
 	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
 	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
 	depends on QCOM_SYSMON || QCOM_SYSMON=n
+	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
 	select MFD_SYSCON
 	select QCOM_PIL_INFO
 	select QCOM_MDT_LOADER
@@ -171,6 +172,7 @@ config QCOM_Q6V5_MSS
 	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
 	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
 	depends on QCOM_SYSMON || QCOM_SYSMON=n
+	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
 	select MFD_SYSCON
 	select QCOM_MDT_LOADER
 	select QCOM_PIL_INFO
@@ -188,6 +190,7 @@ config QCOM_Q6V5_PAS
 	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
 	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
 	depends on QCOM_SYSMON || QCOM_SYSMON=n
+	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
 	select MFD_SYSCON
 	select QCOM_PIL_INFO
 	select QCOM_MDT_LOADER
@@ -206,6 +209,7 @@ config QCOM_Q6V5_WCSS
 	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
 	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
 	depends on QCOM_SYSMON || QCOM_SYSMON=n
+	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
 	select MFD_SYSCON
 	select QCOM_MDT_LOADER
 	select QCOM_PIL_INFO
@@ -238,6 +242,7 @@ config QCOM_WCNSS_PIL
 	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
 	depends on QCOM_SMEM
 	depends on QCOM_SYSMON || QCOM_SYSMON=n
+	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
 	select QCOM_MDT_LOADER
 	select QCOM_PIL_INFO
 	select QCOM_RPROC_COMMON
-- 
2.29.2


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

* Re: [PATCH] remoteproc: qcom: fix glink dependencies
  2021-02-04 15:40 [PATCH] remoteproc: qcom: fix glink dependencies Arnd Bergmann
@ 2021-02-04 16:16 ` Alex Elder
  2021-02-04 17:16   ` Arnd Bergmann
  2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Elder @ 2021-02-04 16:16 UTC (permalink / raw)
  To: Arnd Bergmann, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
	Chris Lew, Rishabh Bhatnagar
  Cc: Arnd Bergmann, Suman Anna, Andrew F. Davis, Alexandre Courbot,
	Siddharth Gupta, Paul Cercueil, Colin Ian King, linux-remoteproc,
	linux-kernel

On 2/4/21 9:40 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Building the remoteproc drivers into the kernel while the qcom_glink
> code is in a loadable module results in a link error:
> 
> ld.lld: error: undefined symbol: qcom_glink_ssr_notify
>>>> referenced by vmlinux.o:(glink_subdev_unprepare)
> 
> Add a Kconfig dependency to avoid this.

So if they're incompatible in that way it's declared in the
header but not defined in the kernel so the link fails.

And at issue is anything that calls qcom_add_glink_subdev(),
which is qcom_q6v5_{adsp,mss,pas,wcss}.c, and those are
selected by CONFIG_QCOM_Q6V5_{ADSP,MSS,PAS,WCSS}.

But I don't see why QCOM_WCNSS_PIL needs the dependency.

Can you explain that?  Other that that this looks good
to me (and I'll offer reviewed-by with your response).

Thanks.

					-Alex

> Fixes: 8527efc59d45 ("rpmsg: glink: Guard qcom_glink_ssr_notify() with correct config")
> Fixes: 5d1f2e3c8090 ("soc: qcom: glink_ssr: Internalize ssr_notifiers")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/remoteproc/Kconfig | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
> index 9e7efe542f69..88488af01fd9 100644
> --- a/drivers/remoteproc/Kconfig
> +++ b/drivers/remoteproc/Kconfig
> @@ -155,6 +155,7 @@ config QCOM_Q6V5_ADSP
>   	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
>   	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
>   	depends on QCOM_SYSMON || QCOM_SYSMON=n
> +	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
>   	select MFD_SYSCON
>   	select QCOM_PIL_INFO
>   	select QCOM_MDT_LOADER
> @@ -171,6 +172,7 @@ config QCOM_Q6V5_MSS
>   	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
>   	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
>   	depends on QCOM_SYSMON || QCOM_SYSMON=n
> +	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
>   	select MFD_SYSCON
>   	select QCOM_MDT_LOADER
>   	select QCOM_PIL_INFO
> @@ -188,6 +190,7 @@ config QCOM_Q6V5_PAS
>   	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
>   	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
>   	depends on QCOM_SYSMON || QCOM_SYSMON=n
> +	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
>   	select MFD_SYSCON
>   	select QCOM_PIL_INFO
>   	select QCOM_MDT_LOADER
> @@ -206,6 +209,7 @@ config QCOM_Q6V5_WCSS
>   	depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)
>   	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
>   	depends on QCOM_SYSMON || QCOM_SYSMON=n
> +	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
>   	select MFD_SYSCON
>   	select QCOM_MDT_LOADER
>   	select QCOM_PIL_INFO
> @@ -238,6 +242,7 @@ config QCOM_WCNSS_PIL
>   	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
>   	depends on QCOM_SMEM
>   	depends on QCOM_SYSMON || QCOM_SYSMON=n
> +	depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
>   	select QCOM_MDT_LOADER
>   	select QCOM_PIL_INFO
>   	select QCOM_RPROC_COMMON
> 


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

* Re: [PATCH] remoteproc: qcom: fix glink dependencies
  2021-02-04 16:16 ` Alex Elder
@ 2021-02-04 17:16   ` Arnd Bergmann
  2021-02-04 17:32     ` Alex Elder
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2021-02-04 17:16 UTC (permalink / raw)
  To: Alex Elder
  Cc: Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier, Chris Lew,
	Rishabh Bhatnagar, Arnd Bergmann, Suman Anna, Andrew F. Davis,
	Alexandre Courbot, Siddharth Gupta, Paul Cercueil,
	Colin Ian King, linux-remoteproc, linux-kernel

On Thu, Feb 4, 2021 at 5:16 PM Alex Elder <elder@linaro.org> wrote:
>
> On 2/4/21 9:40 AM, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > Building the remoteproc drivers into the kernel while the qcom_glink
> > code is in a loadable module results in a link error:
> >
> > ld.lld: error: undefined symbol: qcom_glink_ssr_notify
> >>>> referenced by vmlinux.o:(glink_subdev_unprepare)
> >
> > Add a Kconfig dependency to avoid this.
>
> So if they're incompatible in that way it's declared in the
> header but not defined in the kernel so the link fails.
>
> And at issue is anything that calls qcom_add_glink_subdev(),
> which is qcom_q6v5_{adsp,mss,pas,wcss}.c, and those are
> selected by CONFIG_QCOM_Q6V5_{ADSP,MSS,PAS,WCSS}.
>
> But I don't see why QCOM_WCNSS_PIL needs the dependency.
>
> Can you explain that?  Other that that this looks good
> to me (and I'll offer reviewed-by with your response).

The problem is that QCOM_WCNSS_PIL selects
QCOM_RPROC_COMMON, so qcom_common.o is built-in
whenever QCOM_WCNSS_PIL=y, and this will lead to the
same link failure, regardless of whether the function is needed
or not.

       Arnd

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

* Re: [PATCH] remoteproc: qcom: fix glink dependencies
  2021-02-04 17:16   ` Arnd Bergmann
@ 2021-02-04 17:32     ` Alex Elder
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Elder @ 2021-02-04 17:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier, Chris Lew,
	Rishabh Bhatnagar, Arnd Bergmann, Suman Anna, Andrew F. Davis,
	Alexandre Courbot, Siddharth Gupta, Paul Cercueil,
	Colin Ian King, linux-remoteproc, linux-kernel

On 2/4/21 11:16 AM, Arnd Bergmann wrote:
> On Thu, Feb 4, 2021 at 5:16 PM Alex Elder <elder@linaro.org> wrote:
>>
>> On 2/4/21 9:40 AM, Arnd Bergmann wrote:
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> Building the remoteproc drivers into the kernel while the qcom_glink
>>> code is in a loadable module results in a link error:
>>>
>>> ld.lld: error: undefined symbol: qcom_glink_ssr_notify
>>>>>> referenced by vmlinux.o:(glink_subdev_unprepare)
>>>
>>> Add a Kconfig dependency to avoid this.
>>
>> So if they're incompatible in that way it's declared in the
>> header but not defined in the kernel so the link fails.
>>
>> And at issue is anything that calls qcom_add_glink_subdev(),
>> which is qcom_q6v5_{adsp,mss,pas,wcss}.c, and those are
>> selected by CONFIG_QCOM_Q6V5_{ADSP,MSS,PAS,WCSS}.
>>
>> But I don't see why QCOM_WCNSS_PIL needs the dependency.
>>
>> Can you explain that?  Other that that this looks good
>> to me (and I'll offer reviewed-by with your response).
> 
> The problem is that QCOM_WCNSS_PIL selects
> QCOM_RPROC_COMMON, so qcom_common.o is built-in
> whenever QCOM_WCNSS_PIL=y, and this will lead to the
> same link failure, regardless of whether the function is needed
> or not.

Thanks for the explanation.  Maybe that is something
than get fixed, maybe not.

Reviewed-by: Alex Elder <elder@linaro.org>

>        Arnd
> 


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

* Re: [PATCH] remoteproc: qcom: fix glink dependencies
  2021-02-04 15:40 [PATCH] remoteproc: qcom: fix glink dependencies Arnd Bergmann
  2021-02-04 16:16 ` Alex Elder
@ 2021-02-09 17:40 ` patchwork-bot+linux-remoteproc
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2021-02-09 17:40 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-remoteproc

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

On Thu,  4 Feb 2021 16:40:04 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Building the remoteproc drivers into the kernel while the qcom_glink
> code is in a loadable module results in a link error:
> 
> ld.lld: error: undefined symbol: qcom_glink_ssr_notify
> >>> referenced by vmlinux.o:(glink_subdev_unprepare)
> 
> [...]

Here is the summary with links:
  - remoteproc: qcom: fix glink dependencies
    https://git.kernel.org/andersson/remoteproc/c/bfb44502b8fc

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-02-09 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 15:40 [PATCH] remoteproc: qcom: fix glink dependencies Arnd Bergmann
2021-02-04 16:16 ` Alex Elder
2021-02-04 17:16   ` Arnd Bergmann
2021-02-04 17:32     ` Alex Elder
2021-02-09 17:40 ` patchwork-bot+linux-remoteproc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.