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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212221053.d0IlUvXr-lkp@intel.com>
Date:   Thu, 22 Dec 2022 10:17:31 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kumaravel Thiagarajan <kumaravel.thiagarajan@...rochip.com>,
        arnd@...db.de
Cc:     oe-kbuild-all@...ts.linux.dev, gregkh@...uxfoundation.org,
        linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        unglinuxdriver@...rochip.com,
        Tharun Kumar P <tharunkumar.pasumarthi@...rochip.com>
Subject: Re: [PATCH char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM
 driver for the pci1xxxx switch

Hi Kumaravel,

I love your patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-next]

url:    https://github.com/intel-lab-lkp/linux/commits/Kumaravel-Thiagarajan/misc-microchip-pci1xxxx-Add-OTP-EEPROM-driver-for-the-pci1xxxx-switch/20221222-010842
patch link:    https://lore.kernel.org/r/20221222054048.3080265-1-kumaravel.thiagarajan%40microchip.com
patch subject: [PATCH char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch
config: x86_64-randconfig-a001-20221219
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/1459549ab87dcfc060354d5bd591ee819de77287
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Kumaravel-Thiagarajan/misc-microchip-pci1xxxx-Add-OTP-EEPROM-driver-for-the-pci1xxxx-switch/20221222-010842
        git checkout 1459549ab87dcfc060354d5bd591ee819de77287
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 olddefconfig
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   ld: vmlinux.o: in function `pci1xxxx_otp_e2p_remove':
>> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:616: undefined reference to `blk_mq_destroy_queue'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:619: undefined reference to `del_gendisk'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:620: undefined reference to `put_disk'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:621: undefined reference to `blk_mq_free_tag_set'
   ld: vmlinux.o: in function `otp_e2p_device_create_block_device':
>> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:523: undefined reference to `blk_mq_init_queue'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:533: undefined reference to `blk_queue_logical_block_size'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:535: undefined reference to `blk_queue_physical_block_size'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:539: undefined reference to `__blk_mq_alloc_disk'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:561: undefined reference to `set_capacity'
   ld: vmlinux.o: in function `add_disk':
>> include/linux/blkdev.h:751: undefined reference to `device_add_disk'
   ld: vmlinux.o: in function `otp_e2p_device_create_block_device':
>> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:516: undefined reference to `blk_mq_alloc_tag_set'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:569: undefined reference to `set_capacity'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:591: undefined reference to `del_gendisk'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:592: undefined reference to `put_disk'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:594: undefined reference to `blk_mq_destroy_queue'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:596: undefined reference to `blk_mq_free_tag_set'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:598: undefined reference to `del_gendisk'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:599: undefined reference to `put_disk'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:601: undefined reference to `blk_mq_destroy_queue'
   ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:603: undefined reference to `blk_mq_free_tag_set'
   ld: vmlinux.o: in function `OTPE2P_queue_rq':
>> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:435: undefined reference to `blk_mq_start_request'
>> ld: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:437: undefined reference to `blk_mq_end_request'
   ld: vmlinux.o: in function `pci1xxxx_otp_e2p_driver_init':
>> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:662: undefined reference to `__register_blkdev'
   ld: vmlinux.o: in function `pci1xxxx_otp_e2p_driver_exit':
>> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:684: undefined reference to `unregister_blkdev'


vim +616 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c

   429	
   430	static blk_status_t OTPE2P_queue_rq(struct blk_mq_hw_ctx *hctx,
   431					    const struct blk_mq_queue_data *bd)
   432	{
   433		struct request *req = bd->rq;
   434	
 > 435		blk_mq_start_request(req);
   436		if (!otp_e2P_device_transfer(req)) {
 > 437			blk_mq_end_request(req, BLK_STS_OK);
   438			return BLK_STS_OK;
   439		}
   440	
   441		return BLK_STS_IOERR;
   442	}
   443	
   444	static const struct blk_mq_ops OTPE2P_mq_ops = {
   445		.queue_rq	= OTPE2P_queue_rq,
   446	};
   447	
   448	static const struct block_device_operations otp_e2p_device_ops = {
   449		.owner = THIS_MODULE,
   450		.open = otp_e2p_device_open,
   451		.release = otp_e2p_device_release,
   452	};
   453	
   454	static int otp_e2p_device_create_block_device(struct auxiliary_device *aux_dev)
   455	{
   456		struct auxiliary_device_wrapper *aux_dev_wrapper;
   457		struct pci1xxxx_otp_e2p_device *priv;
   458		struct gp_aux_data_type *pdata;
   459		int retval = 0, i;
   460	
   461		aux_dev_wrapper = (struct auxiliary_device_wrapper *) container_of(aux_dev,
   462				  struct auxiliary_device_wrapper, aux_dev);
   463		pdata = &(aux_dev_wrapper->gp_aux_data);
   464		if (!pdata) {
   465			dev_err(&aux_dev->dev, "Invalid data in aux_dev_wrapper->gp_aux_data\n");
   466			return -EINVAL;
   467		}
   468	
   469		priv = devm_kzalloc(&aux_dev->dev, sizeof(struct pci1xxxx_otp_e2p_device),
   470				    GFP_KERNEL);
   471		if (!priv)
   472			return -ENOMEM;
   473	
   474		priv->pdev = aux_dev;
   475	
   476		dev_set_drvdata(&aux_dev->dev, priv);
   477	
   478		if (!devm_request_mem_region(&aux_dev->dev, pdata->region_start +
   479					     PERI_PF3_SYSTEM_REG_ADDR_BASE,
   480			PERI_PF3_SYSTEM_REG_LENGTH, aux_dev->name)) {
   481			dev_err(&aux_dev->dev, "can't request otpe2p region\n");
   482			return -ENOMEM;
   483		}
   484	
   485		priv->reg_base = devm_ioremap(&aux_dev->dev, pdata->region_start +
   486					      PERI_PF3_SYSTEM_REG_ADDR_BASE,
   487					      PERI_PF3_SYSTEM_REG_LENGTH);
   488		if (!priv->reg_base) {
   489			dev_err(&aux_dev->dev, "ioremap failed\n");
   490			return -ENOMEM;
   491		}
   492	
   493		priv->block_device_count = 0;
   494		do {
   495			if (check_e2p_response(priv))
   496				priv->block_device_count = 2;
   497			else
   498				priv->block_device_count = 1;
   499	
   500			priv->otp_e2p_device = devm_kzalloc(&priv->pdev->dev,
   501							    priv->block_device_count *
   502							    sizeof(struct pci1xxxx_otp_e2p_disk),
   503							    GFP_KERNEL);
   504			if (!priv->otp_e2p_device) {
   505				retval = -ENOMEM;
   506				break;
   507			}
   508	
   509			for (i = 0; i < priv->block_device_count; i++) {
   510				mutex_init(&priv->otp_e2p_device[i].lock);
   511				priv->otp_e2p_device[i].tag_set.ops = &OTPE2P_mq_ops;
   512				priv->otp_e2p_device[i].tag_set.nr_hw_queues = 1;
   513				priv->otp_e2p_device[i].tag_set.queue_depth = 16;
   514				priv->otp_e2p_device[i].tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
   515	
 > 516				retval = blk_mq_alloc_tag_set(&priv->otp_e2p_device[i].tag_set);
   517				if (retval) {
   518					dev_err(&aux_dev->dev, "blk_mq_alloc_tag_set failed\n");
   519					break;
   520				}
   521	
   522				priv->otp_e2p_device[i].queue =
 > 523					blk_mq_init_queue(&priv->otp_e2p_device[i].tag_set);
   524				if (IS_ERR(priv->otp_e2p_device[i].queue)) {
   525					retval = PTR_ERR(priv->otp_e2p_device[i].queue);
   526					priv->otp_e2p_device[i].queue = NULL;
   527					if (i)
   528						goto e2p_free_tag_set;
   529					else
   530						goto otp_free_tag_set;
   531				}
   532	
 > 533				blk_queue_logical_block_size(priv->otp_e2p_device[i].queue,
   534							     OTP_E2P_SECTOR_SIZE);
 > 535				blk_queue_physical_block_size(priv->otp_e2p_device[i].queue,
   536							      OTP_E2P_SECTOR_SIZE);
   537				priv->otp_e2p_device[i].queue->queuedata = priv;
   538				priv->otp_e2p_device[i].gd =
 > 539					blk_mq_alloc_disk(&priv->otp_e2p_device[i].tag_set,
   540					NULL);
   541				if (IS_ERR(priv->otp_e2p_device[i].gd)) {
   542					retval = PTR_ERR(priv->otp_e2p_device[i].gd);
   543					if (i)
   544						goto e2p_destroy_queue;
   545					else
   546						goto otp_destroy_queue;
   547				}
   548	
   549				priv->otp_e2p_device[i].pdev = aux_dev;
   550				priv->otp_e2p_device[i].gd->major = OTP_block_driver_major;
   551				priv->otp_e2p_device[i].gd->minors = 1;
   552				priv->otp_e2p_device[i].gd->first_minor =
   553					otp_device_count + e2p_device_count;
   554				priv->otp_e2p_device[i].gd->fops = &otp_e2p_device_ops;
   555				priv->otp_e2p_device[i].gd->private_data =
   556					&priv->otp_e2p_device[i];
   557	
   558				if (i == 0) {
   559					snprintf(priv->otp_e2p_device[i].gd->disk_name,
   560						 32, "PCI1xxxxOTP%x", otp_device_count);
 > 561					set_capacity(priv->otp_e2p_device[i].gd,
   562						     OTP_sector_count);
   563					priv->otp_e2p_device[i].disk_read_byte = otp_device_read_byte;
   564					priv->otp_e2p_device[i].disk_write_byte = otp_device_write_byte;
   565					otp_device_count++;
   566				} else {
   567					snprintf(priv->otp_e2p_device[i].gd->disk_name,
   568						 32, "PCI1xxxxE2P%x", otp_device_count - 1);
   569					set_capacity(priv->otp_e2p_device[i].gd,
   570						     E2P_sector_count);
   571					priv->otp_e2p_device[i].E2P = true;
   572					priv->otp_e2p_device[i].disk_read_byte = e2p_device_read_byte;
   573					priv->otp_e2p_device[i].disk_write_byte = e2p_device_write_byte;
   574					e2p_device_count++;
   575				}
   576	
   577				retval = add_disk(priv->otp_e2p_device[i].gd);
   578				if (retval) {
   579					if (i)
   580						goto e2p_free_disk;
   581					else
   582						goto otp_free_disk;
   583				}
   584			}
   585	
   586		} while (false);
   587	
   588		return retval;
   589	
   590	e2p_free_disk:
 > 591		del_gendisk(priv->otp_e2p_device[1].gd);
 > 592		put_disk(priv->otp_e2p_device[1].gd);
   593	e2p_destroy_queue:
 > 594		blk_mq_destroy_queue(priv->otp_e2p_device[1].queue);
   595	e2p_free_tag_set:
 > 596		blk_mq_free_tag_set(&priv->otp_e2p_device[1].tag_set);
   597	otp_free_disk:
   598		del_gendisk(priv->otp_e2p_device[0].gd);
 > 599		put_disk(priv->otp_e2p_device[0].gd);
   600	otp_destroy_queue:
   601		blk_mq_destroy_queue(priv->otp_e2p_device[0].queue);
   602	otp_free_tag_set:
   603		blk_mq_free_tag_set(&priv->otp_e2p_device[0].tag_set);
   604	
   605		return retval;
   606	}
   607	
   608	static void pci1xxxx_otp_e2p_remove(struct auxiliary_device *aux_dev)
   609	{
   610		struct pci1xxxx_otp_e2p_device *priv = dev_get_drvdata(&aux_dev->dev);
   611		int i;
   612	
   613		for (i = 0; i < priv->block_device_count; i++) {
   614	
   615			if (priv->otp_e2p_device[i].queue)
 > 616				blk_mq_destroy_queue(priv->otp_e2p_device[i].queue);
   617	
   618			if (priv->otp_e2p_device[i].gd) {
 > 619				del_gendisk(priv->otp_e2p_device[i].gd);
 > 620				put_disk(priv->otp_e2p_device[i].gd);
 > 621				blk_mq_free_tag_set(&priv->otp_e2p_device[i].tag_set);
   622			}
   623		}
   624	}
   625	
   626	static int pci1xxxx_otp_e2p_probe(struct auxiliary_device *aux_dev,
   627					  const struct auxiliary_device_id *id)
   628	{
   629		int retval;
   630	
   631		retval = otp_e2p_device_create_block_device(aux_dev);
   632		if (retval) {
   633			dev_err(&aux_dev->dev,
   634				"otp/eeprom device enumeration failed with errno = %d\n",
   635				retval);
   636			return retval;
   637		}
   638	
   639		return 0;
   640	}
   641	
   642	static const struct auxiliary_device_id pci1xxxx_otp_e2p_auxiliary_id_table[] = {
   643		{.name = "mchp_pci1xxxx_gp.gp_otp_e2p"},
   644		{},
   645	};
   646	MODULE_DEVICE_TABLE(auxiliary, pci1xxxx_otp_e2p_auxiliary_id_table);
   647	
   648	static struct auxiliary_driver pci1xxxx_otp_e2p_driver = {
   649		.driver = {
   650			.name = "PCI1xxxxOTPE2P",
   651		},
   652		.probe = pci1xxxx_otp_e2p_probe,
   653		.remove = pci1xxxx_otp_e2p_remove,
   654		.id_table = pci1xxxx_otp_e2p_auxiliary_id_table
   655	};
   656	
   657	static int __init pci1xxxx_otp_e2p_driver_init(void)
   658	{
   659		int retval;
   660	
   661		do {
 > 662			OTP_block_driver_major = register_blkdev(OTP_block_driver_major,
   663				"OTPBlockDevice");
   664			if (OTP_block_driver_major < 0) {
   665				retval = OTP_block_driver_major;
   666				break;
   667			}
   668	
   669			block_driver_registered = 1;
   670	
   671			retval = auxiliary_driver_register(&pci1xxxx_otp_e2p_driver);
   672			if (retval)
   673				break;
   674	
   675		} while (false);
   676	
   677		return retval;
   678	}
   679	
   680	static void __exit pci1xxxx_otp_e2p_driver_exit(void)
   681	{
   682		auxiliary_driver_unregister(&pci1xxxx_otp_e2p_driver);
   683		if (block_driver_registered)
 > 684			unregister_blkdev(OTP_block_driver_major, "OTPBlockDevice");
   685	}
   686	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (151751 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ