diff mbox series

[2/2] crypto: stm32 - open the configuration for COMPILE_TEST

Message ID 20210825112147.2669-3-caihuoqing@baidu.com (mailing list archive)
State New, archived
Headers show
Series crypto: stm32 - Add support of COMPILE_TEST | expand

Commit Message

Cai,Huoqing Aug. 25, 2021, 11:21 a.m. UTC
it could be opened for complie test in other platform(e.g.X86)

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/crypto/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

kernel test robot Aug. 26, 2021, 8:07 p.m. UTC | #1
Hi Cai,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master stm32/stm32-next v5.14-rc7 next-20210826]
[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]

url:    https://github.com/0day-ci/linux/commits/Cai-Huoqing/crypto-stm32-Add-support-of-COMPILE_TEST/20210825-192234
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: parisc-randconfig-r035-20210827 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/ee7c38e84d0080bed97a670609a489b42494c16f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cai-Huoqing/crypto-stm32-Add-support-of-COMPILE_TEST/20210825-192234
        git checkout ee7c38e84d0080bed97a670609a489b42494c16f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/crypto/stm32/stm32-hash.c: In function 'stm32_hash_dma_send':
>> drivers/crypto/stm32/stm32-hash.c:617:25: error: implicit declaration of function 'writesl'; did you mean 'writel'? [-Werror=implicit-function-declaration]
     617 |                         writesl(hdev->io_base + HASH_DIN, buffer,
         |                         ^~~~~~~
         |                         writel
   cc1: some warnings being treated as errors


vim +617 drivers/crypto/stm32/stm32-hash.c

8a1012d3f2abce lionel.debieve@st.com 2017-07-13  542  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  543  static int stm32_hash_dma_send(struct stm32_hash_dev *hdev)
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  544  {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  545  	struct stm32_hash_request_ctx *rctx = ahash_request_ctx(hdev->req);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  546  	struct scatterlist sg[1], *tsg;
532f419cde077f Arnd Bergmann         2017-09-12  547  	int err = 0, len = 0, reg, ncp = 0;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  548  	unsigned int i;
532f419cde077f Arnd Bergmann         2017-09-12  549  	u32 *buffer = (void *)rctx->buffer;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  550  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  551  	rctx->sg = hdev->req->src;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  552  	rctx->total = hdev->req->nbytes;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  553  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  554  	rctx->nents = sg_nents(rctx->sg);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  555  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  556  	if (rctx->nents < 0)
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  557  		return -EINVAL;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  558  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  559  	stm32_hash_write_ctrl(hdev);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  560  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  561  	if (hdev->flags & HASH_FLAGS_HMAC) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  562  		err = stm32_hash_hmac_dma_send(hdev);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  563  		if (err != -EINPROGRESS)
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  564  			return err;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  565  	}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  566  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  567  	for_each_sg(rctx->sg, tsg, rctx->nents, i) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  568  		len = sg->length;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  569  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  570  		sg[0] = *tsg;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  571  		if (sg_is_last(sg)) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  572  			if (hdev->dma_mode == 1) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  573  				len = (ALIGN(sg->length, 16) - 16);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  574  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  575  				ncp = sg_pcopy_to_buffer(
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  576  					rctx->sg, rctx->nents,
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  577  					rctx->buffer, sg->length - len,
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  578  					rctx->total - sg->length + len);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  579  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  580  				sg->length = len;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  581  			} else {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  582  				if (!(IS_ALIGNED(sg->length, sizeof(u32)))) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  583  					len = sg->length;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  584  					sg->length = ALIGN(sg->length,
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  585  							   sizeof(u32));
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  586  				}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  587  			}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  588  		}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  589  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  590  		rctx->dma_ct = dma_map_sg(hdev->dev, sg, 1,
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  591  					  DMA_TO_DEVICE);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  592  		if (rctx->dma_ct == 0) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  593  			dev_err(hdev->dev, "dma_map_sg error\n");
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  594  			return -ENOMEM;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  595  		}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  596  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  597  		err = stm32_hash_xmit_dma(hdev, sg, len,
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  598  					  !sg_is_last(sg));
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  599  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  600  		dma_unmap_sg(hdev->dev, sg, 1, DMA_TO_DEVICE);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  601  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  602  		if (err == -ENOMEM)
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  603  			return err;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  604  	}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  605  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  606  	if (hdev->dma_mode == 1) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  607  		if (stm32_hash_wait_busy(hdev))
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  608  			return -ETIMEDOUT;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  609  		reg = stm32_hash_read(hdev, HASH_CR);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  610  		reg &= ~HASH_CR_DMAE;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  611  		reg |= HASH_CR_DMAA;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  612  		stm32_hash_write(hdev, HASH_CR, reg);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  613  
532f419cde077f Arnd Bergmann         2017-09-12  614  		if (ncp) {
532f419cde077f Arnd Bergmann         2017-09-12  615  			memset(buffer + ncp, 0,
532f419cde077f Arnd Bergmann         2017-09-12  616  			       DIV_ROUND_UP(ncp, sizeof(u32)) - ncp);
532f419cde077f Arnd Bergmann         2017-09-12 @617  			writesl(hdev->io_base + HASH_DIN, buffer,
532f419cde077f Arnd Bergmann         2017-09-12  618  				DIV_ROUND_UP(ncp, sizeof(u32)));
532f419cde077f Arnd Bergmann         2017-09-12  619  		}
d03d29bd1857b2 Lionel Debieve        2018-01-29  620  		stm32_hash_set_nblw(hdev, ncp);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  621  		reg = stm32_hash_read(hdev, HASH_STR);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  622  		reg |= HASH_STR_DCAL;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  623  		stm32_hash_write(hdev, HASH_STR, reg);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  624  		err = -EINPROGRESS;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  625  	}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  626  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  627  	if (hdev->flags & HASH_FLAGS_HMAC) {
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  628  		if (stm32_hash_wait_busy(hdev))
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  629  			return -ETIMEDOUT;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  630  		err = stm32_hash_hmac_dma_send(hdev);
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  631  	}
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  632  
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  633  	return err;
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  634  }
8a1012d3f2abce lionel.debieve@st.com 2017-07-13  635  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 1fe5120eb966..17b640de1823 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -39,7 +39,7 @@  obj-$(CONFIG_CRYPTO_DEV_S5P) += s5p-sss.o
 obj-$(CONFIG_CRYPTO_DEV_SA2UL) += sa2ul.o
 obj-$(CONFIG_CRYPTO_DEV_SAHARA) += sahara.o
 obj-$(CONFIG_CRYPTO_DEV_SL3516) += gemini/
-obj-$(CONFIG_ARCH_STM32) += stm32/
+obj-y += stm32/
 obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o
 obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/
 obj-$(CONFIG_CRYPTO_DEV_VIRTIO) += virtio/