diff mbox series

[v1,4/4] Enable Driver compilation in crypto Kconfig and Makefile file

Message ID 20240328182652.3587727-5-pavitrakumarm@vayavyalabs.com (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show
Series Add spacc crypto driver support | expand

Commit Message

Pavitrakumar Managutte March 28, 2024, 6:26 p.m. UTC
Signed-off-by: Pavitrakumar M <pavitrakumarm@vayavyalabs.com>
Acked-by: Ruud Derwig <Ruud.Derwig@synopsys.com>
---
 drivers/crypto/Kconfig  | 1 +
 drivers/crypto/Makefile | 1 +
 2 files changed, 2 insertions(+)

Comments

kernel test robot March 30, 2024, 12:40 a.m. UTC | #1
Hi Pavitrakumar,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 6a8dbd71a70620c42d4fa82509204ba18231f28d]

url:    https://github.com/intel-lab-lkp/linux/commits/Pavitrakumar-M/Add-SPAcc-driver-to-Linux-kernel/20240329-023010
base:   6a8dbd71a70620c42d4fa82509204ba18231f28d
patch link:    https://lore.kernel.org/r/20240328182652.3587727-5-pavitrakumarm%40vayavyalabs.com
patch subject: [PATCH v1 4/4] Enable Driver compilation in crypto Kconfig and Makefile file
config: mips-randconfig-r122-20240330 (https://download.01.org/0day-ci/archive/20240330/202403300840.vE1pjy9E-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 79ba323bdd0843275019e16b6e9b35133677c514)
reproduce: (https://download.01.org/0day-ci/archive/20240330/202403300840.vE1pjy9E-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403300840.vE1pjy9E-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/crypto/dwc-spacc/spacc_manager.c:135:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *mem @@     got void * @@
   drivers/crypto/dwc-spacc/spacc_manager.c:135:46: sparse:     expected void volatile [noderef] __iomem *mem
   drivers/crypto/dwc-spacc/spacc_manager.c:135:46: sparse:     got void *

vim +135 drivers/crypto/dwc-spacc/spacc_manager.c

b37587c90bca57 Pavitrakumar M 2024-03-28  107  
b37587c90bca57 Pavitrakumar M 2024-03-28  108  static int spacc_ctx_release(struct spacc_device *spacc, int ctx_id)
b37587c90bca57 Pavitrakumar M 2024-03-28  109  {
b37587c90bca57 Pavitrakumar M 2024-03-28  110  	unsigned long lock_flag;
b37587c90bca57 Pavitrakumar M 2024-03-28  111  	int ncontig;
b37587c90bca57 Pavitrakumar M 2024-03-28  112  	int y;
b37587c90bca57 Pavitrakumar M 2024-03-28  113  
b37587c90bca57 Pavitrakumar M 2024-03-28  114  
b37587c90bca57 Pavitrakumar M 2024-03-28  115  	if (ctx_id < 0 || ctx_id > spacc->config.num_ctx)
b37587c90bca57 Pavitrakumar M 2024-03-28  116  		return -EINVAL;
b37587c90bca57 Pavitrakumar M 2024-03-28  117  
b37587c90bca57 Pavitrakumar M 2024-03-28  118  	spin_lock_irqsave(&spacc->ctx_lock, lock_flag);
b37587c90bca57 Pavitrakumar M 2024-03-28  119  	/* release the base context and contiguous block */
b37587c90bca57 Pavitrakumar M 2024-03-28  120  	ncontig = (&spacc->ctx[ctx_id])->ncontig;
b37587c90bca57 Pavitrakumar M 2024-03-28  121  	for (y = 0; y <= ncontig; y++) {
b37587c90bca57 Pavitrakumar M 2024-03-28  122  		if ((&spacc->ctx[ctx_id + y])->ref_cnt > 0)
b37587c90bca57 Pavitrakumar M 2024-03-28  123  			(&spacc->ctx[ctx_id + y])->ref_cnt--;
b37587c90bca57 Pavitrakumar M 2024-03-28  124  	}
b37587c90bca57 Pavitrakumar M 2024-03-28  125  
b37587c90bca57 Pavitrakumar M 2024-03-28  126  	if ((&spacc->ctx[ctx_id])->ref_cnt == 0) {
b37587c90bca57 Pavitrakumar M 2024-03-28  127  		(&spacc->ctx[ctx_id])->ncontig = 0;
b37587c90bca57 Pavitrakumar M 2024-03-28  128  #ifdef CONFIG_CRYPTO_DEV_SPACC_SECURE_MODE
b37587c90bca57 Pavitrakumar M 2024-03-28  129  		/* TODO:  This driver works in harmony with "normal" kernel
b37587c90bca57 Pavitrakumar M 2024-03-28  130  		 * processes so we release the context all the time
b37587c90bca57 Pavitrakumar M 2024-03-28  131  		 * normally this would be done from a "secure" kernel process
b37587c90bca57 Pavitrakumar M 2024-03-28  132  		 * (trustzone/etc).  This hack is so that SPACC.0
b37587c90bca57 Pavitrakumar M 2024-03-28  133  		 * cores can both use the same context space.
b37587c90bca57 Pavitrakumar M 2024-03-28  134  		 */
b37587c90bca57 Pavitrakumar M 2024-03-28 @135  		writel(ctx_id, spacc->regmap + SPACC_REG_SECURE_RELEASE);
b37587c90bca57 Pavitrakumar M 2024-03-28  136  #endif
b37587c90bca57 Pavitrakumar M 2024-03-28  137  	}
b37587c90bca57 Pavitrakumar M 2024-03-28  138  
b37587c90bca57 Pavitrakumar M 2024-03-28  139  	spin_unlock_irqrestore(&spacc->ctx_lock, lock_flag);
b37587c90bca57 Pavitrakumar M 2024-03-28  140  
b37587c90bca57 Pavitrakumar M 2024-03-28  141  	return CRYPTO_OK;
b37587c90bca57 Pavitrakumar M 2024-03-28  142  }
b37587c90bca57 Pavitrakumar M 2024-03-28  143
diff mbox series

Patch

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 3d02702456a5..aa384d138ae1 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -704,6 +704,7 @@  config CRYPTO_DEV_BCM_SPU
 	  ahash, and aead algorithms with the kernel cryptographic API.
 
 source "drivers/crypto/stm32/Kconfig"
+source "drivers/crypto/dwc-spacc/Kconfig"
 
 config CRYPTO_DEV_SAFEXCEL
 	tristate "Inside Secure's SafeXcel cryptographic engine driver"
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 95331bc6456b..4408927a5a0c 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -47,6 +47,7 @@  obj-$(CONFIG_CRYPTO_DEV_BCM_SPU) += bcm/
 obj-$(CONFIG_CRYPTO_DEV_SAFEXCEL) += inside-secure/
 obj-$(CONFIG_CRYPTO_DEV_ARTPEC6) += axis/
 obj-y += xilinx/
+obj-y += dwc-spacc/
 obj-y += hisilicon/
 obj-$(CONFIG_CRYPTO_DEV_AMLOGIC_GXL) += amlogic/
 obj-y += intel/