From: Bean Huo <beanhuo@iokpp.de>
To: avri.altman@sandisk.com, bvanassche@acm.org,
alim.akhtar@samsung.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, can.guo@oss.qualcomm.com,
beanhuo@micron.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel test robot <lkp@intel.com>
Subject: [PATCH] scsi: ufs: core: Fix link error when CONFIG_RPMB=m
Date: Sun, 30 Nov 2025 16:15:08 +0100 [thread overview]
Message-ID: <20251130151508.3076994-1-beanhuo@iokpp.de> (raw)
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 occurs because IS_ENABLED(CONFIG_RPMB) evaluates to true when
CONFIG_RPMB=m, causing the header to declare the real function prototypes.
However, the Makefile line:
ufshcd-core-$(CONFIG_RPMB) += ufs-rpmb.o
only adds ufs-rpmb.o when CONFIG_RPMB=y (builtin), not when CONFIG_RPMB=m.
This results in the functions being called but not linked into the kernel.
Fix this by changing IS_ENABLED() to IS_BUILTIN(), ensuring the real
functions are only declared when ufs-rpmb.o is actually compiled into
ufshcd-core.
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/
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
drivers/ufs/core/ufshcd-priv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h
index 4259f499382f..9bab6aada072 100644
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -438,7 +438,7 @@ static inline u32 ufshcd_mcq_get_sq_head_slot(struct ufs_hw_queue *q)
return val / sizeof(struct utp_transfer_req_desc);
}
-#if IS_ENABLED(CONFIG_RPMB)
+#if IS_BUILTIN(CONFIG_RPMB)
int ufs_rpmb_probe(struct ufs_hba *hba);
void ufs_rpmb_remove(struct ufs_hba *hba);
#else
--
2.34.1
next reply other threads:[~2025-11-30 15:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-30 15:15 Bean Huo [this message]
2025-12-01 17:25 ` [PATCH] scsi: ufs: core: Fix link error when CONFIG_RPMB=m Martin K. Petersen
2025-12-01 22:42 ` Bean Huo
2025-12-02 0:53 ` Bart Van Assche
2025-12-02 9:12 ` Bean Huo
2025-12-02 11:41 ` Jens Wiklander
2025-12-02 12:17 ` Bean Huo
2025-12-02 13:17 ` Jens Wiklander
2025-12-02 13:25 ` Arnd Bergmann
2025-12-02 14:59 ` Bean Huo
2025-12-02 15:47 ` Arnd Bergmann
2025-12-02 15:57 ` Bean Huo
2025-12-02 14:17 ` Bean Huo
2025-12-03 6:15 ` kernel test robot
2025-12-03 14:39 ` Arnd Bergmann
2025-12-03 16:23 ` Bean Huo
2025-12-03 20:31 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251130151508.3076994-1-beanhuo@iokpp.de \
--to=beanhuo@iokpp.de \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@sandisk.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=can.guo@oss.qualcomm.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox