From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F125C433EF for ; Tue, 1 Mar 2022 01:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B4fAuiLYL4i86F56ZSv461S0t36ytDZvCSy2BcU77b0=; b=QGjN0L/tCrvbEU T3MnItE84yID2pzTR8loA5KOylJxkepJtCLttKjGaalcn+cgnQVd+hbw/kc1UL9jyiqt0xzM+A4ha 1ubctoCU/XaAdoMcIgb/oMenPmOjs1rf45eDM7+88PnKGwdod5ATdXeGZPyJZ8y/eZdcQ+RY5H+mB f94+4pop+zFTrJ8MGzRovpwWliUbaXJn4yIxDXQr/H1Z9ZS4bgN1Lqu5y5sUxjIt987bqw//tTKjE mhBhAjPVlfetlB2HlcDrZiUfyAkWpd8Op3nfDu6JGzLFdrGYTW09rO+g4LH8/tRWeQ/4u7U9ie0/u Be+wKqhPKRT4OqM6Dy2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOr8C-00EZJw-OJ; Tue, 01 Mar 2022 01:16:48 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOr88-00EZIk-DS; Tue, 01 Mar 2022 01:16:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646097404; x=1677633404; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=knh6elYpo4tr7YruYbGImvkmUVglx7N+wZIyoY+SQmA=; b=miLRrNgOuIptkyUtOhBoQyCk/McBHU3ycDZNW7TDCGNPPQsuLJAvewbe n+LqafzKaDWkKis6gkr9udRm1aJeZml9iPVWz8X1yKTLH3dG0W8JA+YAi NK6n3DlKnvnmJETzBNZxSlwZv+2m2Xqtt0DbWMfYNskO+cRVsWWDA+yNb M/AHe0TdAYqYt/nEG0uaYZ5YjoPsr9/HZYyr0hgad7YOVNWKoCMnqr9Qv PnxMdF2OwSXVp3WVfRGMYaMBDwlON3pbYd04M4rTyqMjgqHfidvBtzqD2 Bainr2sOyUAxDtF7ez46+HtjV7SBONprCf5dMf/XoqdgjwCI1PpVDsNLw w==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="250610895" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="250610895" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 17:16:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="641086490" Received: from lkp-server01.sh.intel.com (HELO 788b1cd46f0d) ([10.239.97.150]) by orsmga004.jf.intel.com with ESMTP; 28 Feb 2022 17:16:40 -0800 Received: from kbuild by 788b1cd46f0d with local (Exim 4.92) (envelope-from ) id 1nOr83-0007y4-9f; Tue, 01 Mar 2022 01:16:39 +0000 Date: Tue, 1 Mar 2022 09:15:49 +0800 From: kernel test robot To: Corentin Labbe , heiko@sntech.de, herbert@gondor.apana.org.au, krzysztof.kozlowski@canonical.com, robh+dt@kernel.org Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Corentin Labbe Subject: Re: [PATCH 10/16] crypto: rockchip: rework by using crypto_engine Message-ID: <202203010936.rO3B1boq-lkp@intel.com> References: <20220228194037.1600509-11-clabbe@baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220228194037.1600509-11-clabbe@baylibre.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_171644_499206_82BC41EC X-CRM114-Status: GOOD ( 17.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Corentin, I love your patch! Perhaps something to improve: [auto build test WARNING on rockchip/for-next] [also build test WARNING on herbert-cryptodev-2.6/master herbert-crypto-2.6/master v5.17-rc6 next-20220228] [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/Corentin-Labbe/crypto-rockchip-permit-to-pass-self-tests/20220301-035430 base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next config: arm64-randconfig-r006-20220228 (https://download.01.org/0day-ci/archive/20220301/202203010936.rO3B1boq-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) 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 # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/0day-ci/linux/commit/7e5f8e4a5f09473643937e0ecff342bf336793fb git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Corentin-Labbe/crypto-rockchip-permit-to-pass-self-tests/20220301-035430 git checkout 7e5f8e4a5f09473643937e0ecff342bf336793fb # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/crypto/rockchip/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/crypto/rockchip/rk3288_crypto_skcipher.c:386:10: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat] todo, rctx->mode & RK_CRYPTO_DEC); ^~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg' dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk' _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ drivers/crypto/rockchip/rk3288_crypto_skcipher.c:474:24: warning: unused variable 'ctx' [-Wunused-variable] struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); ^ 2 warnings generated. vim +386 drivers/crypto/rockchip/rk3288_crypto_skcipher.c 311 312 static int rk_cipher_run(struct crypto_engine *engine, void *async_req) 313 { 314 struct skcipher_request *areq = container_of(async_req, struct skcipher_request, base); 315 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq); 316 struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); 317 struct rk_cipher_rctx *rctx = skcipher_request_ctx(areq); 318 struct scatterlist *sgs, *sgd; 319 int err = 0; 320 int n = 0; 321 int ivsize = crypto_skcipher_ivsize(tfm); 322 int offset; 323 u8 iv[AES_BLOCK_SIZE]; 324 u8 biv[AES_BLOCK_SIZE]; 325 u8 *ivtouse = areq->iv; 326 unsigned int len = areq->cryptlen; 327 unsigned int todo; 328 329 ivsize = crypto_skcipher_ivsize(tfm); 330 if (areq->iv && crypto_skcipher_ivsize(tfm) > 0) { 331 if (rctx->mode & RK_CRYPTO_DEC) { 332 offset = areq->cryptlen - ivsize; 333 scatterwalk_map_and_copy(rctx->backup_iv, areq->src, 334 offset, ivsize, 0); 335 } 336 } 337 338 sgs = areq->src; 339 sgd = areq->dst; 340 341 while (sgs && sgd && len) { 342 if (!sgs->length) { 343 sgs = sg_next(sgs); 344 sgd = sg_next(sgd); 345 continue; 346 } 347 if (rctx->mode & RK_CRYPTO_DEC) { 348 /* we backup last block of source to be used as IV at next step */ 349 offset = sgs->length - ivsize; 350 scatterwalk_map_and_copy(biv, sgs, offset, ivsize, 0); 351 } 352 if (sgs == sgd) { 353 err = dma_map_sg(ctx->dev->dev, sgs, 1, DMA_BIDIRECTIONAL); 354 if (err <= 0) { 355 err = -EINVAL; 356 goto theend_iv; 357 } 358 } else { 359 err = dma_map_sg(ctx->dev->dev, sgs, 1, DMA_TO_DEVICE); 360 if (err <= 0) { 361 err = -EINVAL; 362 goto theend_iv; 363 } 364 err = dma_map_sg(ctx->dev->dev, sgd, 1, DMA_FROM_DEVICE); 365 if (err <= 0) { 366 err = -EINVAL; 367 goto theend_sgs; 368 } 369 } 370 err = 0; 371 rk_ablk_hw_init(ctx->dev, areq); 372 if (ivsize) { 373 if (ivsize == DES_BLOCK_SIZE) 374 memcpy_toio(ctx->dev->reg + RK_CRYPTO_TDES_IV_0, ivtouse, ivsize); 375 else 376 memcpy_toio(ctx->dev->reg + RK_CRYPTO_AES_IV_0, ivtouse, ivsize); 377 } 378 reinit_completion(&ctx->dev->complete); 379 ctx->dev->status = 0; 380 381 todo = min(sg_dma_len(sgs), len); 382 len -= todo; 383 dev_dbg(ctx->dev->dev, "LEN=%d/%d/%u ivsize=%d mode=%x n=%d BI=%d todo=%u way=%x\n", 384 sg_dma_len(sgs), sg_dma_len(sgd), areq->cryptlen, 385 ivsize, rctx->mode, n, sgs == sgd, > 386 todo, rctx->mode & RK_CRYPTO_DEC); 387 crypto_dma_start(ctx->dev, sgs, sgd, todo / 4); 388 wait_for_completion_interruptible_timeout(&ctx->dev->complete, 389 msecs_to_jiffies(2000)); 390 if (!ctx->dev->status) { 391 dev_err(ctx->dev->dev, "DMA timeout\n"); 392 err = -EFAULT; 393 goto theend; 394 } 395 if (sgs == sgd) { 396 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_BIDIRECTIONAL); 397 } else { 398 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_TO_DEVICE); 399 dma_unmap_sg(ctx->dev->dev, sgd, 1, DMA_FROM_DEVICE); 400 } 401 if (rctx->mode & RK_CRYPTO_DEC) { 402 memcpy(iv, biv, ivsize); 403 ivtouse = iv; 404 } else { 405 offset = sgd->length - ivsize; 406 scatterwalk_map_and_copy(iv, sgd, offset, ivsize, 0); 407 ivtouse = iv; 408 } 409 sgs = sg_next(sgs); 410 sgd = sg_next(sgd); 411 n++; 412 } 413 414 if (areq->iv && ivsize > 0) { 415 offset = areq->cryptlen - ivsize; 416 if (rctx->mode & RK_CRYPTO_DEC) { 417 memcpy(areq->iv, rctx->backup_iv, ivsize); 418 memzero_explicit(rctx->backup_iv, ivsize); 419 } else { 420 scatterwalk_map_and_copy(areq->iv, areq->dst, offset, 421 ivsize, 0); 422 } 423 } 424 425 theend: 426 local_bh_disable(); 427 crypto_finalize_skcipher_request(engine, areq, err); 428 local_bh_enable(); 429 return 0; 430 431 theend_sgs: 432 if (sgs == sgd) { 433 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_BIDIRECTIONAL); 434 } else { 435 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_TO_DEVICE); 436 dma_unmap_sg(ctx->dev->dev, sgd, 1, DMA_FROM_DEVICE); 437 } 438 theend_iv: 439 return err; 440 } 441 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel