Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Fix RPMB link error by reversing Kconfig dependencies

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: b06b8c421485 ("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>

authored by

Bean Huo and committed by
Martin K. Petersen
d98b4d52 9086cac8

+1 -1
-1
drivers/misc/Kconfig
··· 106 106 107 107 config RPMB 108 108 tristate "RPMB partition interface" 109 - depends on MMC || SCSI_UFSHCD 110 109 help 111 110 Unified RPMB unit interface for RPMB capable devices such as eMMC and 112 111 UFS. Provides interface for in-kernel security controllers to access
+1
drivers/ufs/Kconfig
··· 6 6 menuconfig SCSI_UFSHCD 7 7 tristate "Universal Flash Storage Controller" 8 8 depends on SCSI && SCSI_DMA 9 + depends on RPMB || !RPMB 9 10 select PM_DEVFREQ 10 11 select DEVFREQ_GOV_SIMPLE_ONDEMAND 11 12 select NLS