linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH
@ 2020-10-27 11:14 Anders Roxell
  2020-10-27 11:44 ` Naresh Kamboju
  2020-10-27 21:15 ` Lina Iyer
  0 siblings, 2 replies; 5+ messages in thread
From: Anders Roxell @ 2020-10-27 11:14 UTC (permalink / raw)
  To: agross, bjorn.andersson; +Cc: linux-arm-msm, linux-kernel, Anders Roxell

When building allmodconfig leading to the following link error with
CONFIG_QCOM_RPMH=y and CONFIG_QCOM_COMMAND_DB=m:

aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_probe':
  drivers/clk/qcom/clk-rpmh.c:474: undefined reference to `cmd_db_read_addr'
  drivers/clk/qcom/clk-rpmh.c:474:(.text+0x254): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cmd_db_read_addr'

Fix this by adding a Kconfig depenency and forcing QCOM_RPMH to be a
module when QCOM_COMMAND_DB is a module. Also removing the dependency on
'ARCH_QCOM || COMPILE_TEST' since that is already a dependency for
QCOM_COMMAND_DB.

Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/soc/qcom/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 9b4ae9c16ba7..3bdd1604f78f 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -109,7 +109,7 @@ config QCOM_RMTFS_MEM
 
 config QCOM_RPMH
 	tristate "Qualcomm RPM-Hardened (RPMH) Communication"
-	depends on ARCH_QCOM || COMPILE_TEST
+	depends on QCOM_COMMAND_DB
 	help
 	  Support for communication with the hardened-RPM blocks in
 	  Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an
-- 
2.28.0


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

* Re: [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH
  2020-10-27 11:14 [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH Anders Roxell
@ 2020-10-27 11:44 ` Naresh Kamboju
  2020-10-27 21:15 ` Lina Iyer
  1 sibling, 0 replies; 5+ messages in thread
From: Naresh Kamboju @ 2020-10-27 11:44 UTC (permalink / raw)
  To: Anders Roxell; +Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, open list

On Tue, 27 Oct 2020 at 16:45, Anders Roxell <anders.roxell@linaro.org> wrote:
>
> When building allmodconfig leading to the following link error with
> CONFIG_QCOM_RPMH=y and CONFIG_QCOM_COMMAND_DB=m:
>
> aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_probe':
>   drivers/clk/qcom/clk-rpmh.c:474: undefined reference to `cmd_db_read_addr'
>   drivers/clk/qcom/clk-rpmh.c:474:(.text+0x254): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cmd_db_read_addr'
>
> Fix this by adding a Kconfig depenency and forcing QCOM_RPMH to be a
> module when QCOM_COMMAND_DB is a module. Also removing the dependency on
> 'ARCH_QCOM || COMPILE_TEST' since that is already a dependency for
> QCOM_COMMAND_DB.
>
> Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>

This patch fixed the arm64 build error.

> ---
>  drivers/soc/qcom/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index 9b4ae9c16ba7..3bdd1604f78f 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -109,7 +109,7 @@ config QCOM_RMTFS_MEM
>
>  config QCOM_RPMH
>         tristate "Qualcomm RPM-Hardened (RPMH) Communication"
> -       depends on ARCH_QCOM || COMPILE_TEST
> +       depends on QCOM_COMMAND_DB
>         help
>           Support for communication with the hardened-RPM blocks in
>           Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an


Build error noticed on linux next 20201027 tag.

 LD      .tmp_vmlinux.kallsyms1
aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected!
aarch64-linux-gnu-ld: Unexpected run-time procedure linkages detected!
aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_probe':
/home/naresh/kernel/next/linux-next/drivers/clk/qcom/clk-rpmh.c:474:
undefined reference to `cmd_db_read_addr'
aarch64-linux-gnu-ld:
/home/naresh/kernel/next/linux-next/drivers/clk/qcom/clk-rpmh.c:481:
undefined reference to `cmd_db_read_aux_data'
aarch64-linux-gnu-ld: drivers/soc/qcom/rpmh-rsc.o: in function `rpmh_rsc_probe':
/home/naresh/kernel/next/linux-next/drivers/soc/qcom/rpmh-rsc.c:948:
undefined reference to `cmd_db_ready'
aarch64-linux-gnu-ld: drivers/regulator/qcom-rpmh-regulator.o: in
function `rpmh_regulator_init_vreg':
/home/naresh/kernel/next/linux-next/drivers/regulator/qcom-rpmh-regulator.c:438:
undefined reference to `cmd_db_read_addr'
make: *** [Makefile:1164: vmlinux] Error 1

- Naresh

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

* Re: [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH
  2020-10-27 11:14 [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH Anders Roxell
  2020-10-27 11:44 ` Naresh Kamboju
@ 2020-10-27 21:15 ` Lina Iyer
  2020-10-28  9:43   ` Anders Roxell
  1 sibling, 1 reply; 5+ messages in thread
From: Lina Iyer @ 2020-10-27 21:15 UTC (permalink / raw)
  To: Anders Roxell
  Cc: agross, bjorn.andersson, linux-arm-msm, linux-kernel, mkshah

Hi Anders,

On Tue, Oct 27 2020 at 05:14 -0600, Anders Roxell wrote:
>When building allmodconfig leading to the following link error with
>CONFIG_QCOM_RPMH=y and CONFIG_QCOM_COMMAND_DB=m:
>
>aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_probe':
>  drivers/clk/qcom/clk-rpmh.c:474: undefined reference to `cmd_db_read_addr'
>  drivers/clk/qcom/clk-rpmh.c:474:(.text+0x254): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cmd_db_read_addr'
>
>Fix this by adding a Kconfig depenency and forcing QCOM_RPMH to be a
>module when QCOM_COMMAND_DB is a module. Also removing the dependency on
>'ARCH_QCOM || COMPILE_TEST' since that is already a dependency for
>QCOM_COMMAND_DB.
>
>Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module")
>Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>---
> drivers/soc/qcom/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
>index 9b4ae9c16ba7..3bdd1604f78f 100644
>--- a/drivers/soc/qcom/Kconfig
>+++ b/drivers/soc/qcom/Kconfig
>@@ -109,7 +109,7 @@ config QCOM_RMTFS_MEM
>
> config QCOM_RPMH
> 	tristate "Qualcomm RPM-Hardened (RPMH) Communication"
>-	depends on ARCH_QCOM || COMPILE_TEST
>+	depends on QCOM_COMMAND_DB
A solution was posted in the mailing list alredy -
https://lore.kernel.org/linux-arm-msm/20201008040907.7036-1-ilina@codeaurora.org/

If you get a chance, please give that a shot to see if that works for
you.

Thanks,
Lina

> 	help
> 	  Support for communication with the hardened-RPM blocks in
> 	  Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an
>-- 
>2.28.0
>

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

* Re: [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH
  2020-10-27 21:15 ` Lina Iyer
@ 2020-10-28  9:43   ` Anders Roxell
  2020-10-28 14:35     ` Lina Iyer
  0 siblings, 1 reply; 5+ messages in thread
From: Anders Roxell @ 2020-10-28  9:43 UTC (permalink / raw)
  To: Lina Iyer
  Cc: agross, Bjorn Andersson, linux-arm-msm,
	Linux Kernel Mailing List, mkshah

On Tue, 27 Oct 2020 at 22:15, Lina Iyer <ilina@codeaurora.org> wrote:
>
> Hi Anders,
>
> On Tue, Oct 27 2020 at 05:14 -0600, Anders Roxell wrote:
> >When building allmodconfig leading to the following link error with
> >CONFIG_QCOM_RPMH=y and CONFIG_QCOM_COMMAND_DB=m:
> >
> >aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_probe':
> >  drivers/clk/qcom/clk-rpmh.c:474: undefined reference to `cmd_db_read_addr'
> >  drivers/clk/qcom/clk-rpmh.c:474:(.text+0x254): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cmd_db_read_addr'
> >
> >Fix this by adding a Kconfig depenency and forcing QCOM_RPMH to be a
> >module when QCOM_COMMAND_DB is a module. Also removing the dependency on
> >'ARCH_QCOM || COMPILE_TEST' since that is already a dependency for
> >QCOM_COMMAND_DB.
> >
> >Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module")
> >Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> >---
> > drivers/soc/qcom/Kconfig | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> >index 9b4ae9c16ba7..3bdd1604f78f 100644
> >--- a/drivers/soc/qcom/Kconfig
> >+++ b/drivers/soc/qcom/Kconfig
> >@@ -109,7 +109,7 @@ config QCOM_RMTFS_MEM
> >
> > config QCOM_RPMH
> >       tristate "Qualcomm RPM-Hardened (RPMH) Communication"
> >-      depends on ARCH_QCOM || COMPILE_TEST
> >+      depends on QCOM_COMMAND_DB
> A solution was posted in the mailing list alredy -
> https://lore.kernel.org/linux-arm-msm/20201008040907.7036-1-ilina@codeaurora.org/

I missed that one, thanks.

>
> If you get a chance, please give that a shot to see if that works for
> you.

That will work too, but the "depends on ARCH_QCOM || COMPILE_TEST"
isn't needed since that is already the dependency for QCOM_COMMAND_DB.
So that should be met here too or am I missing something?

Cheers,
Anders

>
> Thanks,
> Lina
>
> >       help
> >         Support for communication with the hardened-RPM blocks in
> >         Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an
> >--
> >2.28.0
> >

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

* Re: [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH
  2020-10-28  9:43   ` Anders Roxell
@ 2020-10-28 14:35     ` Lina Iyer
  0 siblings, 0 replies; 5+ messages in thread
From: Lina Iyer @ 2020-10-28 14:35 UTC (permalink / raw)
  To: Anders Roxell
  Cc: agross, Bjorn Andersson, linux-arm-msm,
	Linux Kernel Mailing List, mkshah

On Wed, Oct 28 2020 at 03:43 -0600, Anders Roxell wrote:
>On Tue, 27 Oct 2020 at 22:15, Lina Iyer <ilina@codeaurora.org> wrote:
>>
>> Hi Anders,
>>
>> On Tue, Oct 27 2020 at 05:14 -0600, Anders Roxell wrote:
>> >When building allmodconfig leading to the following link error with
>> >CONFIG_QCOM_RPMH=y and CONFIG_QCOM_COMMAND_DB=m:
>> >
>> >aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_probe':
>> >  drivers/clk/qcom/clk-rpmh.c:474: undefined reference to `cmd_db_read_addr'
>> >  drivers/clk/qcom/clk-rpmh.c:474:(.text+0x254): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cmd_db_read_addr'
>> >
>> >Fix this by adding a Kconfig depenency and forcing QCOM_RPMH to be a
>> >module when QCOM_COMMAND_DB is a module. Also removing the dependency on
>> >'ARCH_QCOM || COMPILE_TEST' since that is already a dependency for
>> >QCOM_COMMAND_DB.
>> >
>> >Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module")
>> >Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>> >---
>> > drivers/soc/qcom/Kconfig | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> >diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
>> >index 9b4ae9c16ba7..3bdd1604f78f 100644
>> >--- a/drivers/soc/qcom/Kconfig
>> >+++ b/drivers/soc/qcom/Kconfig
>> >@@ -109,7 +109,7 @@ config QCOM_RMTFS_MEM
>> >
>> > config QCOM_RPMH
>> >       tristate "Qualcomm RPM-Hardened (RPMH) Communication"
>> >-      depends on ARCH_QCOM || COMPILE_TEST
>> >+      depends on QCOM_COMMAND_DB
>> A solution was posted in the mailing list alredy -
>> https://lore.kernel.org/linux-arm-msm/20201008040907.7036-1-ilina@codeaurora.org/
>
>I missed that one, thanks.
>
>>
>> If you get a chance, please give that a shot to see if that works for
>> you.
>
>That will work too, but the "depends on ARCH_QCOM || COMPILE_TEST"
>isn't needed since that is already the dependency for QCOM_COMMAND_DB.
>So that should be met here too or am I missing something?
>
Sure, if you want to post an update to the patch, that would be fine
too.
Bjorn: Have you picked up this patch yet? If he hasn't please feel free
to update the patch. Or, I can do that as well.

--Lina

>Cheers,
>Anders
>
>>
>> Thanks,
>> Lina
>>
>> >       help
>> >         Support for communication with the hardened-RPM blocks in
>> >         Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an
>> >--
>> >2.28.0
>> >

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

end of thread, other threads:[~2020-10-28 22:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 11:14 [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH Anders Roxell
2020-10-27 11:44 ` Naresh Kamboju
2020-10-27 21:15 ` Lina Iyer
2020-10-28  9:43   ` Anders Roxell
2020-10-28 14:35     ` Lina Iyer

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).