Re: [PATCH v3 RESEND 3/9] crypto/ycc: Add irq support for ycc kernel rings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi 'Guanjun',

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221103-154448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/1667461243-48652-4-git-send-email-guanjun%40linux.alibaba.com
patch subject: [PATCH v3 RESEND 3/9] crypto/ycc: Add irq support for ycc kernel rings
config: ia64-randconfig-m031-20221104
compiler: ia64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>

smatch warnings:
drivers/crypto/ycc/ycc_isr.c:124 ycc_alloc_irqs() warn: missing error code 'ret'

vim +/ret +124 drivers/crypto/ycc/ycc_isr.c

99da43fc5ee114 Zelin Deng 2022-11-03   98  
99da43fc5ee114 Zelin Deng 2022-11-03   99  int ycc_alloc_irqs(struct ycc_dev *ydev)
99da43fc5ee114 Zelin Deng 2022-11-03  100  {
99da43fc5ee114 Zelin Deng 2022-11-03  101  	struct pci_dev *rcec_pdev = ydev->assoc_dev->pdev;
99da43fc5ee114 Zelin Deng 2022-11-03  102  	int num = ydev->is_vf ? 1 : YCC_RINGPAIR_NUM;
3c2d80e20cfe81 Zelin Deng 2022-11-03  103  	int cpu, cpus = num_online_cpus();
3c2d80e20cfe81 Zelin Deng 2022-11-03  104  	int ret, i, j;
99da43fc5ee114 Zelin Deng 2022-11-03  105  
3c2d80e20cfe81 Zelin Deng 2022-11-03  106  	/* The 0 - (YCC_RINGPAIR_NUM-1) are rings irqs, the last one is dev error irq */
99da43fc5ee114 Zelin Deng 2022-11-03  107  	sprintf(ydev->err_irq_name, "ycc_dev_%d_global_err", ydev->id);
99da43fc5ee114 Zelin Deng 2022-11-03  108  	ret = request_irq(pci_irq_vector(rcec_pdev, num),
99da43fc5ee114 Zelin Deng 2022-11-03  109  			  ycc_g_err_isr, 0, ydev->err_irq_name, ydev);
3c2d80e20cfe81 Zelin Deng 2022-11-03  110  	if (ret) {
99da43fc5ee114 Zelin Deng 2022-11-03  111  		pr_err("Failed to alloc global irq interrupt for dev: %d\n", ydev->id);
3c2d80e20cfe81 Zelin Deng 2022-11-03  112  		goto out;
3c2d80e20cfe81 Zelin Deng 2022-11-03  113  	}
3c2d80e20cfe81 Zelin Deng 2022-11-03  114  
3c2d80e20cfe81 Zelin Deng 2022-11-03  115  	if (ydev->is_polling)
3c2d80e20cfe81 Zelin Deng 2022-11-03  116  		goto out;
3c2d80e20cfe81 Zelin Deng 2022-11-03  117  
3c2d80e20cfe81 Zelin Deng 2022-11-03  118  	for (i = 0; i < num; i++) {
3c2d80e20cfe81 Zelin Deng 2022-11-03  119  		if (ydev->rings[i].type != KERN_RING)
3c2d80e20cfe81 Zelin Deng 2022-11-03  120  			continue;
3c2d80e20cfe81 Zelin Deng 2022-11-03  121  
3c2d80e20cfe81 Zelin Deng 2022-11-03  122  		ydev->msi_name[i] = kzalloc(16, GFP_KERNEL);
3c2d80e20cfe81 Zelin Deng 2022-11-03  123  		if (!ydev->msi_name[i])
3c2d80e20cfe81 Zelin Deng 2022-11-03 @124  			goto free_irq;

ret = -ENOMEM;

3c2d80e20cfe81 Zelin Deng 2022-11-03  125  		snprintf(ydev->msi_name[i], 16, "ycc_ring_%d", i);
3c2d80e20cfe81 Zelin Deng 2022-11-03  126  		ret = request_irq(pci_irq_vector(rcec_pdev, i), ycc_resp_isr,
3c2d80e20cfe81 Zelin Deng 2022-11-03  127  				  0, ydev->msi_name[i], &ydev->rings[i]);
3c2d80e20cfe81 Zelin Deng 2022-11-03  128  		if (ret) {
3c2d80e20cfe81 Zelin Deng 2022-11-03  129  			kfree(ydev->msi_name[i]);
3c2d80e20cfe81 Zelin Deng 2022-11-03  130  			goto free_irq;
3c2d80e20cfe81 Zelin Deng 2022-11-03  131  		}
3c2d80e20cfe81 Zelin Deng 2022-11-03  132  		if (!ydev->is_vf)
3c2d80e20cfe81 Zelin Deng 2022-11-03  133  			cpu = (i % YCC_RINGPAIR_NUM) % cpus;
3c2d80e20cfe81 Zelin Deng 2022-11-03  134  		else
3c2d80e20cfe81 Zelin Deng 2022-11-03  135  			cpu = smp_processor_id() % cpus;
3c2d80e20cfe81 Zelin Deng 2022-11-03  136  
3c2d80e20cfe81 Zelin Deng 2022-11-03  137  		ret = irq_set_affinity_hint(pci_irq_vector(rcec_pdev, i),
3c2d80e20cfe81 Zelin Deng 2022-11-03  138  					    get_cpu_mask(cpu));
3c2d80e20cfe81 Zelin Deng 2022-11-03  139  		if (ret) {
3c2d80e20cfe81 Zelin Deng 2022-11-03  140  			free_irq(pci_irq_vector(rcec_pdev, i), &ydev->rings[i]);
3c2d80e20cfe81 Zelin Deng 2022-11-03  141  			kfree(ydev->msi_name[i]);
3c2d80e20cfe81 Zelin Deng 2022-11-03  142  			goto free_irq;
3c2d80e20cfe81 Zelin Deng 2022-11-03  143  		}
3c2d80e20cfe81 Zelin Deng 2022-11-03  144  	}
3c2d80e20cfe81 Zelin Deng 2022-11-03  145  
3c2d80e20cfe81 Zelin Deng 2022-11-03  146  	return 0;
3c2d80e20cfe81 Zelin Deng 2022-11-03  147  
3c2d80e20cfe81 Zelin Deng 2022-11-03  148  free_irq:
3c2d80e20cfe81 Zelin Deng 2022-11-03  149  	for (j = 0; j < i; j++) {
3c2d80e20cfe81 Zelin Deng 2022-11-03  150  		if (ydev->rings[i].type != KERN_RING)
3c2d80e20cfe81 Zelin Deng 2022-11-03  151  			continue;
3c2d80e20cfe81 Zelin Deng 2022-11-03  152  
3c2d80e20cfe81 Zelin Deng 2022-11-03  153  		free_irq(pci_irq_vector(rcec_pdev, j), &ydev->rings[j]);
3c2d80e20cfe81 Zelin Deng 2022-11-03  154  		kfree(ydev->msi_name[j]);
3c2d80e20cfe81 Zelin Deng 2022-11-03  155  	}
3c2d80e20cfe81 Zelin Deng 2022-11-03  156  	free_irq(pci_irq_vector(rcec_pdev, num), ydev);
3c2d80e20cfe81 Zelin Deng 2022-11-03  157  out:
99da43fc5ee114 Zelin Deng 2022-11-03  158  
99da43fc5ee114 Zelin Deng 2022-11-03  159  	return ret;
99da43fc5ee114 Zelin Deng 2022-11-03  160  }

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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux