mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
When CONFIG_SCSI_UFSHCD=y and CONFIG_RPMB=m, the kernel fails to link
with undefined references to ufs_rpmb_probe() and ufs_rpmb_remove():
ld: drivers/ufs/core/ufshcd.c:8950: undefined reference to `ufs_rpmb_probe'
ld: drivers/ufs/core/ufshcd.c:10505: undefined reference to `ufs_rpmb_remove'
The issue is that RPMB depends on its consumers (MMC, UFS) in Kconfig,
which is backwards. This prevents proper module dependency handling when
the library is modular but consumers are built-in.
Fix by reversing the dependency:
- Remove 'depends on MMC || SCSI_UFSHCD' from RPMB Kconfig
- Add 'depends on RPMB || !RPMB' to SCSI_UFSHCD Kconfig
This allows RPMB to be an independent library while ensuring correct
linking in all module/built-in combinations.
Fixes: b06b8c4214 ("scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511300443.h7sotuL0-lkp@intel.com/
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251202155138.2607210-1-beanhuo@iokpp.de
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
32 lines
908 B
Plaintext
32 lines
908 B
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# UFS subsystem configuration
|
|
#
|
|
|
|
menuconfig SCSI_UFSHCD
|
|
tristate "Universal Flash Storage Controller"
|
|
depends on SCSI && SCSI_DMA
|
|
depends on RPMB || !RPMB
|
|
select PM_DEVFREQ
|
|
select DEVFREQ_GOV_SIMPLE_ONDEMAND
|
|
select NLS
|
|
help
|
|
Enables support for UFS (Universal Flash Storage) host controllers.
|
|
A UFS host controller is an electronic component that is able to
|
|
communicate with a UFS card. UFS host controllers occur in
|
|
smartphones, laptops, digital cameras and also in cars.
|
|
The kernel module will be called ufshcd.
|
|
|
|
To compile this driver as a module, choose M here and read
|
|
<file:Documentation/scsi/ufs.rst>.
|
|
However, do not compile this as a module if your root file system
|
|
(the one containing the directory /) is located on a UFS device.
|
|
|
|
if SCSI_UFSHCD
|
|
|
|
source "drivers/ufs/core/Kconfig"
|
|
|
|
source "drivers/ufs/host/Kconfig"
|
|
|
|
endif
|