mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: rpmb: register and unregister the ufs_rpmb bus
@ 2026-09-20 14:50 Dmitry Baryshkov
  2026-09-20 17:05 ` Stanley Jhu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-09-20 14:50 UTC (permalink / raw)
  To: Alim Akhtar, Avri Altman, Bart Van Assche, James E.J. Bottomley,
	Martin K. Petersen, Can Guo, Bean Huo
  Cc: linux-scsi, linux-kernel, linux-arm-msm

The ufs_rpmb bus isn't registered in the device framework, so any
attempt to register RPMB devices on UFS will fail with:

 bus_add_device: cannot add device 'ufs_rpmb0' to unregistered bus 'ufs_rpmb'
 ufshcd-qcom 1d84000.ufshc: Failed to register UFS RPMB device 0

Add module_init() / exit() functions to handle bus registration and
unregistration.

Fixes: b06b8c421485 ("scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/ufs/core/ufs-rpmb.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/ufs/core/ufs-rpmb.c b/drivers/ufs/core/ufs-rpmb.c
index 50ef63afd528..8ae917adbc98 100644
--- a/drivers/ufs/core/ufs-rpmb.c
+++ b/drivers/ufs/core/ufs-rpmb.c
@@ -275,5 +275,18 @@ void ufs_rpmb_remove(struct ufs_hba *hba)
 	dev_info(hba->dev, "All UFS RPMB devices unregistered\n");
 }
 
+static int __init ufs_rpmb_init(void)
+{
+	return bus_register(&ufs_rpmb_bus_type);
+}
+
+static void __exit ufs_rpmb_exit(void)
+{
+	bus_unregister(&ufs_rpmb_bus_type);
+}
+
+module_init(ufs_rpmb_init);
+module_exit(ufs_rpmb_exit);
+
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("OP-TEE UFS RPMB driver");

---
base-commit: 3f2425f5b5bbbdd991ca9cdfd5502e68d8895998
change-id: 20260511-fix-ufs-rpmb-487d73d091b7

Best regards,
--  
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-26  1:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 14:50 [PATCH] scsi: ufs: rpmb: register and unregister the ufs_rpmb bus Dmitry Baryshkov
2026-09-20 17:05 ` Stanley Jhu
2026-09-25 22:36 ` kernel test robot
2026-09-26  1:49 ` kernel test robot

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®