Skip to content

Commit 512d4a2

Browse files
arndbGeorgi Djakov
authored andcommitted
interconnect: qcom: fix rpmh link failures
When CONFIG_COMPILE_TEST is set, it is possible to build some of the interconnect drivers into the kernel while their dependencies are loadable modules, which is bad: arm-linux-gnueabi-ld: drivers/interconnect/qcom/bcm-voter.o: in function `qcom_icc_bcm_voter_commit': (.text+0x1f8): undefined reference to `rpmh_invalidate' arm-linux-gnueabi-ld: (.text+0x20c): undefined reference to `rpmh_write_batch' arm-linux-gnueabi-ld: (.text+0x2b0): undefined reference to `rpmh_write_batch' arm-linux-gnueabi-ld: (.text+0x2e8): undefined reference to `rpmh_write_batch' arm-linux-gnueabi-ld: drivers/interconnect/qcom/icc-rpmh.o: in function `qcom_icc_bcm_init': (.text+0x2ac): undefined reference to `cmd_db_read_addr' arm-linux-gnueabi-ld: (.text+0x2c8): undefined reference to `cmd_db_read_aux_data' The exact dependencies are a bit complicated, so split them out into a hidden Kconfig symbol that all drivers can in turn depend on to get it right. Fixes: 976daac ("interconnect: qcom: Consolidate interconnect RPMh support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20201204165030.3747484-1-arnd@kernel.org Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
1 parent 5c8fe58 commit 512d4a2

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

drivers/interconnect/qcom/Kconfig

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,23 @@ config INTERCONNECT_QCOM_QCS404
4242
This is a driver for the Qualcomm Network-on-Chip on qcs404-based
4343
platforms.
4444

45+
config INTERCONNECT_QCOM_RPMH_POSSIBLE
46+
tristate
47+
default INTERCONNECT_QCOM
48+
depends on QCOM_RPMH || (COMPILE_TEST && !QCOM_RPMH)
49+
depends on QCOM_COMMAND_DB || (COMPILE_TEST && !QCOM_COMMAND_DB)
50+
depends on OF || COMPILE_TEST
51+
help
52+
Compile-testing RPMH drivers is possible on other platforms,
53+
but in order to avoid link failures, drivers must not be built-in
54+
when QCOM_RPMH or QCOM_COMMAND_DB are loadable modules
55+
4556
config INTERCONNECT_QCOM_RPMH
4657
tristate
4758

4859
config INTERCONNECT_QCOM_SC7180
4960
tristate "Qualcomm SC7180 interconnect driver"
50-
depends on INTERCONNECT_QCOM
51-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
61+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
5262
select INTERCONNECT_QCOM_RPMH
5363
select INTERCONNECT_QCOM_BCM_VOTER
5464
help
@@ -57,8 +67,7 @@ config INTERCONNECT_QCOM_SC7180
5767

5868
config INTERCONNECT_QCOM_SDM845
5969
tristate "Qualcomm SDM845 interconnect driver"
60-
depends on INTERCONNECT_QCOM
61-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
70+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
6271
select INTERCONNECT_QCOM_RPMH
6372
select INTERCONNECT_QCOM_BCM_VOTER
6473
help
@@ -67,8 +76,7 @@ config INTERCONNECT_QCOM_SDM845
6776

6877
config INTERCONNECT_QCOM_SM8150
6978
tristate "Qualcomm SM8150 interconnect driver"
70-
depends on INTERCONNECT_QCOM
71-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
79+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
7280
select INTERCONNECT_QCOM_RPMH
7381
select INTERCONNECT_QCOM_BCM_VOTER
7482
help
@@ -77,8 +85,7 @@ config INTERCONNECT_QCOM_SM8150
7785

7886
config INTERCONNECT_QCOM_SM8250
7987
tristate "Qualcomm SM8250 interconnect driver"
80-
depends on INTERCONNECT_QCOM
81-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
88+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
8289
select INTERCONNECT_QCOM_RPMH
8390
select INTERCONNECT_QCOM_BCM_VOTER
8491
help

0 commit comments

Comments
 (0)