lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202512031316.SvDwnvhy-lkp@intel.com>
Date: Wed, 3 Dec 2025 14:15:55 +0800
From: kernel test robot <lkp@...el.com>
To: Bean Huo <beanhuo@...pp.de>, avri.altman@...disk.com,
	bvanassche@....org, alim.akhtar@...sung.com, jejb@...ux.ibm.com,
	martin.petersen@...cle.com, can.guo@....qualcomm.com,
	beanhuo@...ron.com
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] scsi: ufs: core: Fix link error when CONFIG_RPMB=m

Hi Bean,

kernel test robot noticed the following build errors:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on jejb-scsi/for-next mkp-scsi/6.19/scsi-queue next-20251202]
[cannot apply to linus/master v6.18]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bean-Huo/scsi-ufs-core-Fix-link-error-when-CONFIG_RPMB-m/20251130-231759
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
patch link:    https://lore.kernel.org/r/20251130151508.3076994-1-beanhuo%40iokpp.de
patch subject: [PATCH] scsi: ufs: core: Fix link error when CONFIG_RPMB=m
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20251203/202512031316.SvDwnvhy-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251203/202512031316.SvDwnvhy-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512031316.SvDwnvhy-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/ufs/core/ufs-rpmb.c:135:5: error: redefinition of 'ufs_rpmb_probe'
     135 | int ufs_rpmb_probe(struct ufs_hba *hba)
         |     ^
   drivers/ufs/core/ufshcd-priv.h:445:19: note: previous definition is here
     445 | static inline int ufs_rpmb_probe(struct ufs_hba *hba)
         |                   ^
>> drivers/ufs/core/ufs-rpmb.c:234:6: error: redefinition of 'ufs_rpmb_remove'
     234 | void ufs_rpmb_remove(struct ufs_hba *hba)
         |      ^
   drivers/ufs/core/ufshcd-priv.h:449:20: note: previous definition is here
     449 | static inline void ufs_rpmb_remove(struct ufs_hba *hba)
         |                    ^
   2 errors generated.


vim +/ufs_rpmb_probe +135 drivers/ufs/core/ufs-rpmb.c

b06b8c421485e0 Bean Huo 2025-11-08  133  
b06b8c421485e0 Bean Huo 2025-11-08  134  /* UFS RPMB device registration */
b06b8c421485e0 Bean Huo 2025-11-08 @135  int ufs_rpmb_probe(struct ufs_hba *hba)
b06b8c421485e0 Bean Huo 2025-11-08  136  {
b06b8c421485e0 Bean Huo 2025-11-08  137  	struct ufs_rpmb_dev *ufs_rpmb, *it, *tmp;
b06b8c421485e0 Bean Huo 2025-11-08  138  	struct rpmb_dev *rdev;
b06b8c421485e0 Bean Huo 2025-11-08  139  	char *cid = NULL;
b06b8c421485e0 Bean Huo 2025-11-08  140  	int region;
b06b8c421485e0 Bean Huo 2025-11-08  141  	u32 cap;
b06b8c421485e0 Bean Huo 2025-11-08  142  	int ret;
b06b8c421485e0 Bean Huo 2025-11-08  143  
b06b8c421485e0 Bean Huo 2025-11-08  144  	if (!hba->ufs_rpmb_wlun || hba->dev_info.b_advanced_rpmb_en) {
b06b8c421485e0 Bean Huo 2025-11-08  145  		dev_info(hba->dev, "Skip OP-TEE RPMB registration\n");
b06b8c421485e0 Bean Huo 2025-11-08  146  		return -ENODEV;
b06b8c421485e0 Bean Huo 2025-11-08  147  	}
b06b8c421485e0 Bean Huo 2025-11-08  148  
b06b8c421485e0 Bean Huo 2025-11-08  149  	/* Check if device_id is available */
b06b8c421485e0 Bean Huo 2025-11-08  150  	if (!hba->dev_info.device_id) {
b06b8c421485e0 Bean Huo 2025-11-08  151  		dev_err(hba->dev, "UFS Device ID not available\n");
b06b8c421485e0 Bean Huo 2025-11-08  152  		return -EINVAL;
b06b8c421485e0 Bean Huo 2025-11-08  153  	}
b06b8c421485e0 Bean Huo 2025-11-08  154  
b06b8c421485e0 Bean Huo 2025-11-08  155  	INIT_LIST_HEAD(&hba->rpmbs);
b06b8c421485e0 Bean Huo 2025-11-08  156  
b06b8c421485e0 Bean Huo 2025-11-08  157  	struct rpmb_descr descr = {
b06b8c421485e0 Bean Huo 2025-11-08  158  		.type = RPMB_TYPE_UFS,
b06b8c421485e0 Bean Huo 2025-11-08  159  		.route_frames = ufs_rpmb_route_frames,
b06b8c421485e0 Bean Huo 2025-11-08  160  		.reliable_wr_count = hba->dev_info.rpmb_io_size,
b06b8c421485e0 Bean Huo 2025-11-08  161  	};
b06b8c421485e0 Bean Huo 2025-11-08  162  
b06b8c421485e0 Bean Huo 2025-11-08  163  	for (region = 0; region < ARRAY_SIZE(hba->dev_info.rpmb_region_size); region++) {
b06b8c421485e0 Bean Huo 2025-11-08  164  		cap = hba->dev_info.rpmb_region_size[region];
b06b8c421485e0 Bean Huo 2025-11-08  165  		if (!cap)
b06b8c421485e0 Bean Huo 2025-11-08  166  			continue;
b06b8c421485e0 Bean Huo 2025-11-08  167  
b06b8c421485e0 Bean Huo 2025-11-08  168  		ufs_rpmb = devm_kzalloc(hba->dev, sizeof(*ufs_rpmb), GFP_KERNEL);
b06b8c421485e0 Bean Huo 2025-11-08  169  		if (!ufs_rpmb) {
b06b8c421485e0 Bean Huo 2025-11-08  170  			ret = -ENOMEM;
b06b8c421485e0 Bean Huo 2025-11-08  171  			goto err_out;
b06b8c421485e0 Bean Huo 2025-11-08  172  		}
b06b8c421485e0 Bean Huo 2025-11-08  173  
b06b8c421485e0 Bean Huo 2025-11-08  174  		ufs_rpmb->hba = hba;
b06b8c421485e0 Bean Huo 2025-11-08  175  		ufs_rpmb->dev.parent = &hba->ufs_rpmb_wlun->sdev_gendev;
b06b8c421485e0 Bean Huo 2025-11-08  176  		ufs_rpmb->dev.bus = &ufs_rpmb_bus_type;
b06b8c421485e0 Bean Huo 2025-11-08  177  		ufs_rpmb->dev.release = ufs_rpmb_device_release;
b06b8c421485e0 Bean Huo 2025-11-08  178  		dev_set_name(&ufs_rpmb->dev, "ufs_rpmb%d", region);
b06b8c421485e0 Bean Huo 2025-11-08  179  
b06b8c421485e0 Bean Huo 2025-11-08  180  		/* Set driver data BEFORE device_register */
b06b8c421485e0 Bean Huo 2025-11-08  181  		dev_set_drvdata(&ufs_rpmb->dev, ufs_rpmb);
b06b8c421485e0 Bean Huo 2025-11-08  182  
b06b8c421485e0 Bean Huo 2025-11-08  183  		ret = device_register(&ufs_rpmb->dev);
b06b8c421485e0 Bean Huo 2025-11-08  184  		if (ret) {
b06b8c421485e0 Bean Huo 2025-11-08  185  			dev_err(hba->dev, "Failed to register UFS RPMB device %d\n", region);
b06b8c421485e0 Bean Huo 2025-11-08  186  			put_device(&ufs_rpmb->dev);
b06b8c421485e0 Bean Huo 2025-11-08  187  			goto err_out;
b06b8c421485e0 Bean Huo 2025-11-08  188  		}
b06b8c421485e0 Bean Huo 2025-11-08  189  
b06b8c421485e0 Bean Huo 2025-11-08  190  		/* Create unique ID by appending region number to device_id */
b06b8c421485e0 Bean Huo 2025-11-08  191  		cid = kasprintf(GFP_KERNEL, "%s-R%d", hba->dev_info.device_id, region);
b06b8c421485e0 Bean Huo 2025-11-08  192  		if (!cid) {
b06b8c421485e0 Bean Huo 2025-11-08  193  			device_unregister(&ufs_rpmb->dev);
b06b8c421485e0 Bean Huo 2025-11-08  194  			ret = -ENOMEM;
b06b8c421485e0 Bean Huo 2025-11-08  195  			goto err_out;
b06b8c421485e0 Bean Huo 2025-11-08  196  		}
b06b8c421485e0 Bean Huo 2025-11-08  197  
b06b8c421485e0 Bean Huo 2025-11-08  198  		descr.dev_id = cid;
b06b8c421485e0 Bean Huo 2025-11-08  199  		descr.dev_id_len = strlen(cid);
b06b8c421485e0 Bean Huo 2025-11-08  200  		descr.capacity = cap;
b06b8c421485e0 Bean Huo 2025-11-08  201  
b06b8c421485e0 Bean Huo 2025-11-08  202  		/* Register RPMB device */
b06b8c421485e0 Bean Huo 2025-11-08  203  		rdev = rpmb_dev_register(&ufs_rpmb->dev, &descr);
b06b8c421485e0 Bean Huo 2025-11-08  204  		if (IS_ERR(rdev)) {
b06b8c421485e0 Bean Huo 2025-11-08  205  			dev_err(hba->dev, "Failed to register UFS RPMB device.\n");
b06b8c421485e0 Bean Huo 2025-11-08  206  			device_unregister(&ufs_rpmb->dev);
b06b8c421485e0 Bean Huo 2025-11-08  207  			ret = PTR_ERR(rdev);
b06b8c421485e0 Bean Huo 2025-11-08  208  			goto err_out;
b06b8c421485e0 Bean Huo 2025-11-08  209  		}
b06b8c421485e0 Bean Huo 2025-11-08  210  
b06b8c421485e0 Bean Huo 2025-11-08  211  		kfree(cid);
b06b8c421485e0 Bean Huo 2025-11-08  212  		cid = NULL;
b06b8c421485e0 Bean Huo 2025-11-08  213  
b06b8c421485e0 Bean Huo 2025-11-08  214  		ufs_rpmb->rdev = rdev;
b06b8c421485e0 Bean Huo 2025-11-08  215  		ufs_rpmb->region_id = region;
b06b8c421485e0 Bean Huo 2025-11-08  216  
b06b8c421485e0 Bean Huo 2025-11-08  217  		list_add_tail(&ufs_rpmb->node, &hba->rpmbs);
b06b8c421485e0 Bean Huo 2025-11-08  218  
b06b8c421485e0 Bean Huo 2025-11-08  219  		dev_info(hba->dev, "UFS RPMB region %d registered (capacity=%u)\n", region, cap);
b06b8c421485e0 Bean Huo 2025-11-08  220  	}
b06b8c421485e0 Bean Huo 2025-11-08  221  
b06b8c421485e0 Bean Huo 2025-11-08  222  	return 0;
b06b8c421485e0 Bean Huo 2025-11-08  223  err_out:
b06b8c421485e0 Bean Huo 2025-11-08  224  	kfree(cid);
b06b8c421485e0 Bean Huo 2025-11-08  225  	list_for_each_entry_safe(it, tmp, &hba->rpmbs, node) {
b06b8c421485e0 Bean Huo 2025-11-08  226  		list_del(&it->node);
b06b8c421485e0 Bean Huo 2025-11-08  227  		device_unregister(&it->dev);
b06b8c421485e0 Bean Huo 2025-11-08  228  	}
b06b8c421485e0 Bean Huo 2025-11-08  229  
b06b8c421485e0 Bean Huo 2025-11-08  230  	return ret;
b06b8c421485e0 Bean Huo 2025-11-08  231  }
b06b8c421485e0 Bean Huo 2025-11-08  232  
b06b8c421485e0 Bean Huo 2025-11-08  233  /* UFS RPMB remove handler */
b06b8c421485e0 Bean Huo 2025-11-08 @234  void ufs_rpmb_remove(struct ufs_hba *hba)
b06b8c421485e0 Bean Huo 2025-11-08  235  {
b06b8c421485e0 Bean Huo 2025-11-08  236  	struct ufs_rpmb_dev *ufs_rpmb, *tmp;
b06b8c421485e0 Bean Huo 2025-11-08  237  
b06b8c421485e0 Bean Huo 2025-11-08  238  	if (list_empty(&hba->rpmbs))
b06b8c421485e0 Bean Huo 2025-11-08  239  		return;
b06b8c421485e0 Bean Huo 2025-11-08  240  
b06b8c421485e0 Bean Huo 2025-11-08  241  	/* Remove all registered RPMB devices */
b06b8c421485e0 Bean Huo 2025-11-08  242  	list_for_each_entry_safe(ufs_rpmb, tmp, &hba->rpmbs, node) {
b06b8c421485e0 Bean Huo 2025-11-08  243  		dev_info(hba->dev, "Removing UFS RPMB region %d\n", ufs_rpmb->region_id);
b06b8c421485e0 Bean Huo 2025-11-08  244  		/* Remove from list first */
b06b8c421485e0 Bean Huo 2025-11-08  245  		list_del(&ufs_rpmb->node);
b06b8c421485e0 Bean Huo 2025-11-08  246  		/* Unregister device */
b06b8c421485e0 Bean Huo 2025-11-08  247  		device_unregister(&ufs_rpmb->dev);
b06b8c421485e0 Bean Huo 2025-11-08  248  	}
b06b8c421485e0 Bean Huo 2025-11-08  249  
b06b8c421485e0 Bean Huo 2025-11-08  250  	dev_info(hba->dev, "All UFS RPMB devices unregistered\n");
b06b8c421485e0 Bean Huo 2025-11-08  251  }
b06b8c421485e0 Bean Huo 2025-11-08  252  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ