Skip to content

Commit 424953c

Browse files
committed
qcom_scm: hide Kconfig symbol
Now that SCM can be a loadable module, we have to add another dependency to avoid link failures when ipa or adreno-gpu are built-in: aarch64-linux-ld: drivers/net/ipa/ipa_main.o: in function `ipa_probe': ipa_main.c:(.text+0xfc4): undefined reference to `qcom_scm_is_available' ld.lld: error: undefined symbol: qcom_scm_is_available >>> referenced by adreno_gpu.c >>> gpu/drm/msm/adreno/adreno_gpu.o:(adreno_zap_shader_load) in archive drivers/built-in.a This can happen when CONFIG_ARCH_QCOM is disabled and we don't select QCOM_MDT_LOADER, but some other module selects QCOM_SCM. Ideally we'd use a similar dependency here to what we have for QCOM_RPROC_COMMON, but that causes dependency loops from other things selecting QCOM_SCM. This appears to be an endless problem, so try something different this time: - CONFIG_QCOM_SCM becomes a hidden symbol that nothing 'depends on' but that is simply selected by all of its users - All the stubs in include/linux/qcom_scm.h can go away - arm-smccc.h needs to provide a stub for __arm_smccc_smc() to allow compile-testing QCOM_SCM on all architectures. - To avoid a circular dependency chain involving RESET_CONTROLLER and PINCTRL_SUNXI, drop the 'select RESET_CONTROLLER' statement. According to my testing this still builds fine, and the QCOM platform selects this symbol already. Acked-by: Kalle Valo <[email protected]> Acked-by: Alex Elder <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 951cd3a commit 424953c

File tree

12 files changed

+24
-85
lines changed

12 files changed

+24
-85
lines changed

drivers/firmware/Kconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,7 @@ config INTEL_STRATIX10_RSU
203203
Say Y here if you want Intel RSU support.
204204

205205
config QCOM_SCM
206-
tristate "Qcom SCM driver"
207-
depends on ARM || ARM64
208-
depends on HAVE_ARM_SMCCC
209-
select RESET_CONTROLLER
206+
tristate
210207

211208
config QCOM_SCM_DOWNLOAD_MODE_DEFAULT
212209
bool "Qualcomm download mode enabled by default"

drivers/gpu/drm/msm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ config DRM_MSM
1717
select DRM_SCHED
1818
select SHMEM
1919
select TMPFS
20-
select QCOM_SCM if ARCH_QCOM
20+
select QCOM_SCM
2121
select WANT_DEV_COREDUMP
2222
select SND_SOC_HDMI_CODEC if SND_SOC
2323
select SYNC_FILE
@@ -55,7 +55,7 @@ config DRM_MSM_GPU_SUDO
5555

5656
config DRM_MSM_HDMI_HDCP
5757
bool "Enable HDMI HDCP support in MSM DRM driver"
58-
depends on DRM_MSM && QCOM_SCM
58+
depends on DRM_MSM
5959
default y
6060
help
6161
Choose this option to enable HDCP state machine

drivers/iommu/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ config APPLE_DART
308308
config ARM_SMMU
309309
tristate "ARM Ltd. System MMU (SMMU) Support"
310310
depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
311-
depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y
312311
select IOMMU_API
313312
select IOMMU_IO_PGTABLE_LPAE
314313
select ARM_DMA_USE_IOMMU if ARM
@@ -438,7 +437,7 @@ config QCOM_IOMMU
438437
# Note: iommu drivers cannot (yet?) be built as modules
439438
bool "Qualcomm IOMMU Support"
440439
depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
441-
depends on QCOM_SCM=y
440+
select QCOM_SCM
442441
select IOMMU_API
443442
select IOMMU_IO_PGTABLE_LPAE
444443
select ARM_DMA_USE_IOMMU

drivers/iommu/arm/arm-smmu/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_QCOM_IOMMU) += qcom_iommu.o
33
obj-$(CONFIG_ARM_SMMU) += arm_smmu.o
4-
arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-nvidia.o arm-smmu-qcom.o
4+
arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-nvidia.o
5+
arm_smmu-$(CONFIG_ARM_SMMU_QCOM) += arm-smmu-qcom.o

drivers/iommu/arm/arm-smmu/arm-smmu-impl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)
215215
of_device_is_compatible(np, "nvidia,tegra186-smmu"))
216216
return nvidia_smmu_impl_init(smmu);
217217

218-
smmu = qcom_smmu_impl_init(smmu);
218+
if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM))
219+
smmu = qcom_smmu_impl_init(smmu);
219220

220221
if (of_device_is_compatible(np, "marvell,ap806-smmu-500"))
221222
smmu->impl = &mrvl_mmu500_impl;

drivers/media/platform/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ config VIDEO_QCOM_VENUS
565565
depends on VIDEO_DEV && VIDEO_V4L2 && QCOM_SMEM
566566
depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST
567567
select QCOM_MDT_LOADER if ARCH_QCOM
568-
select QCOM_SCM if ARCH_QCOM
568+
select QCOM_SCM
569569
select VIDEOBUF2_DMA_CONTIG
570570
select V4L2_MEM2MEM_DEV
571571
help

drivers/mmc/host/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ config MMC_SDHCI_MSM
547547
depends on MMC_SDHCI_PLTFM
548548
select MMC_SDHCI_IO_ACCESSORS
549549
select MMC_CQHCI
550-
select QCOM_SCM if MMC_CRYPTO && ARCH_QCOM
550+
select QCOM_SCM if MMC_CRYPTO
551551
help
552552
This selects the Secure Digital Host Controller Interface (SDHCI)
553553
support present in Qualcomm SOCs. The controller supports

drivers/net/ipa/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config QCOM_IPA
44
depends on ARCH_QCOM || COMPILE_TEST
55
depends on QCOM_RPROC_COMMON || (QCOM_RPROC_COMMON=n && COMPILE_TEST)
66
select QCOM_MDT_LOADER if ARCH_QCOM
7+
select QCOM_SCM
78
select QCOM_QMI_HELPERS
89
help
910
Choose Y or M here to include support for the Qualcomm

drivers/net/wireless/ath/ath10k/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ config ATH10K_SNOC
4444
tristate "Qualcomm ath10k SNOC support"
4545
depends on ATH10K
4646
depends on ARCH_QCOM || COMPILE_TEST
47-
depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y
47+
select QCOM_SCM
4848
select QCOM_QMI_HELPERS
4949
help
5050
This module adds support for integrated WCN3990 chip connected

drivers/pinctrl/qcom/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ if (ARCH_QCOM || COMPILE_TEST)
33

44
config PINCTRL_MSM
55
tristate "Qualcomm core pin controller driver"
6-
depends on GPIOLIB && (QCOM_SCM || !QCOM_SCM) #if QCOM_SCM=m this can't be =y
6+
depends on GPIOLIB
7+
select QCOM_SCM
78
select PINMUX
89
select PINCONF
910
select GENERIC_PINCONF

0 commit comments

Comments
 (0)