Commit 424953cf authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

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: default avatarKalle Valo <kvalo@codeaurora.org>
Acked-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 951cd3a0
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -203,10 +203,7 @@ config INTEL_STRATIX10_RSU
	  Say Y here if you want Intel RSU support.

config QCOM_SCM
	tristate "Qcom SCM driver"
	depends on ARM || ARM64
	depends on HAVE_ARM_SMCCC
	select RESET_CONTROLLER
	tristate

config QCOM_SCM_DOWNLOAD_MODE_DEFAULT
	bool "Qualcomm download mode enabled by default"
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ config DRM_MSM
	select DRM_SCHED
	select SHMEM
	select TMPFS
	select QCOM_SCM if ARCH_QCOM
	select QCOM_SCM
	select WANT_DEV_COREDUMP
	select SND_SOC_HDMI_CODEC if SND_SOC
	select SYNC_FILE
@@ -55,7 +55,7 @@ config DRM_MSM_GPU_SUDO

config DRM_MSM_HDMI_HDCP
	bool "Enable HDMI HDCP support in MSM DRM driver"
	depends on DRM_MSM && QCOM_SCM
	depends on DRM_MSM
	default y
	help
	  Choose this option to enable HDCP state machine
+1 −2
Original line number Diff line number Diff line
@@ -308,7 +308,6 @@ config APPLE_DART
config ARM_SMMU
	tristate "ARM Ltd. System MMU (SMMU) Support"
	depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
	depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y
	select IOMMU_API
	select IOMMU_IO_PGTABLE_LPAE
	select ARM_DMA_USE_IOMMU if ARM
@@ -438,7 +437,7 @@ config QCOM_IOMMU
	# Note: iommu drivers cannot (yet?) be built as modules
	bool "Qualcomm IOMMU Support"
	depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
	depends on QCOM_SCM=y
	select QCOM_SCM
	select IOMMU_API
	select IOMMU_IO_PGTABLE_LPAE
	select ARM_DMA_USE_IOMMU
+2 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_QCOM_IOMMU) += qcom_iommu.o
obj-$(CONFIG_ARM_SMMU) += arm_smmu.o
arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-nvidia.o arm-smmu-qcom.o
arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-nvidia.o
arm_smmu-$(CONFIG_ARM_SMMU_QCOM) += arm-smmu-qcom.o
+2 −1
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)
	    of_device_is_compatible(np, "nvidia,tegra186-smmu"))
		return nvidia_smmu_impl_init(smmu);

	if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM))
		smmu = qcom_smmu_impl_init(smmu);

	if (of_device_is_compatible(np, "marvell,ap806-smmu-500"))
Loading