* [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
@ 2025-12-02 15:51 Bean Huo
2025-12-02 15:57 ` Arnd Bergmann
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Bean Huo @ 2025-12-02 15:51 UTC (permalink / raw)
To: avri.altman, avri.altman, bvanassche, alim.akhtar, jejb,
martin.petersen, can.guo, ulf.hansson, beanhuo, jens.wiklander,
arnd
Cc: linux-scsi, linux-kernel, kernel test robot
From: Bean Huo <beanhuo@micron.com>
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>
---
drivers/misc/Kconfig | 1 -
drivers/ufs/Kconfig | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 9d1de68dee27..d7d41b054b98 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -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
diff --git a/drivers/ufs/Kconfig b/drivers/ufs/Kconfig
index 90226f72c158..f662e7ce71f1 100644
--- a/drivers/ufs/Kconfig
+++ b/drivers/ufs/Kconfig
@@ -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
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
2025-12-02 15:51 [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies Bean Huo
@ 2025-12-02 15:57 ` Arnd Bergmann
2025-12-02 16:07 ` Jens Wiklander
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2025-12-02 15:57 UTC (permalink / raw)
To: Bean Huo, Avri Altman, avri.altman, Bart Van Assche, Alim Akhtar,
James E.J. Bottomley, Martin K. Petersen, can.guo, Ulf Hansson,
Bean Huo, Jens Wiklander
Cc: linux-scsi, linux-kernel, kernel test robot
On Tue, Dec 2, 2025, at 16:51, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
>
> 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>
Looks good to me,
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
2025-12-02 15:51 [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies Bean Huo
2025-12-02 15:57 ` Arnd Bergmann
@ 2025-12-02 16:07 ` Jens Wiklander
2025-12-03 0:04 ` Bart Van Assche
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jens Wiklander @ 2025-12-02 16:07 UTC (permalink / raw)
To: Bean Huo
Cc: avri.altman, avri.altman, bvanassche, alim.akhtar, jejb,
martin.petersen, can.guo, ulf.hansson, beanhuo, arnd, linux-scsi,
linux-kernel, kernel test robot
On Tue, Dec 2, 2025 at 4:52 PM Bean Huo <beanhuo@iokpp.de> wrote:
>
> From: Bean Huo <beanhuo@micron.com>
>
> 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>
> ---
> drivers/misc/Kconfig | 1 -
> drivers/ufs/Kconfig | 1 +
> 2 files changed, 1 insertion(+), 1 deletion(-)
Looks good:
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Cheers,
Jens
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
2025-12-02 15:51 [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies Bean Huo
2025-12-02 15:57 ` Arnd Bergmann
2025-12-02 16:07 ` Jens Wiklander
@ 2025-12-03 0:04 ` Bart Van Assche
2025-12-03 6:35 ` Martin K. Petersen
2025-12-09 3:21 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2025-12-03 0:04 UTC (permalink / raw)
To: Bean Huo, avri.altman, avri.altman, alim.akhtar, jejb,
martin.petersen, can.guo, ulf.hansson, beanhuo, jens.wiklander,
arnd
Cc: linux-scsi, linux-kernel, kernel test robot
On 12/2/25 5:51 AM, Bean Huo wrote:
> Fix by reversing the dependency:
> - Remove 'depends on MMC || SCSI_UFSHCD' from RPMB Kconfig
> - Add 'depends on RPMB || !RPMB' to SCSI_UFSHCD Kconfig
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
2025-12-02 15:51 [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies Bean Huo
` (2 preceding siblings ...)
2025-12-03 0:04 ` Bart Van Assche
@ 2025-12-03 6:35 ` Martin K. Petersen
2025-12-09 3:21 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2025-12-03 6:35 UTC (permalink / raw)
To: Bean Huo
Cc: avri.altman, avri.altman, bvanassche, alim.akhtar, jejb,
martin.petersen, can.guo, ulf.hansson, beanhuo, jens.wiklander,
arnd, linux-scsi, linux-kernel, kernel test robot
Bean,
> 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():
Applied to 6.19/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
2025-12-02 15:51 [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies Bean Huo
` (3 preceding siblings ...)
2025-12-03 6:35 ` Martin K. Petersen
@ 2025-12-09 3:21 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2025-12-09 3:21 UTC (permalink / raw)
To: avri.altman, avri.altman, bvanassche, alim.akhtar, jejb, can.guo,
ulf.hansson, beanhuo, jens.wiklander, arnd, Bean Huo
Cc: Martin K . Petersen, linux-scsi, linux-kernel, kernel test robot
On Tue, 02 Dec 2025 16:51:38 +0100, Bean Huo wrote:
> 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.
>
> [...]
Applied to 6.19/scsi-queue, thanks!
[1/1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies
https://git.kernel.org/mkp/scsi/c/d98b4d52bff0
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-09 3:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-02 15:51 [PATCH v1] scsi: ufs: Fix RPMB link error by reversing Kconfig dependencies Bean Huo
2025-12-02 15:57 ` Arnd Bergmann
2025-12-02 16:07 ` Jens Wiklander
2025-12-03 0:04 ` Bart Van Assche
2025-12-03 6:35 ` Martin K. Petersen
2025-12-09 3:21 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®