]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: core: Fix RPMB link error by reversing Kconfig dependencies
authorBean Huo <beanhuo@micron.com>
Tue, 2 Dec 2025 15:51:38 +0000 (16:51 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 3 Dec 2025 06:33:10 +0000 (01:33 -0500)
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>
drivers/misc/Kconfig
drivers/ufs/Kconfig

index 9d1de68dee278c449935826a446d20a9a2f7c30e..d7d41b054b9824f341f20f09410bad1d4c1e361f 100644 (file)
@@ -106,7 +106,6 @@ config PHANTOM
 
 config RPMB
        tristate "RPMB partition interface"
-       depends on MMC || SCSI_UFSHCD
        help
          Unified RPMB unit interface for RPMB capable devices such as eMMC and
          UFS. Provides interface for in-kernel security controllers to access
index 90226f72c158aad3253f5854f02c4a66ea25d83f..f662e7ce71f1bdc8b73daf3584b6785cbca05ec3 100644 (file)
@@ -6,6 +6,7 @@
 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