Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3494479pxb; Mon, 4 Apr 2022 18:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUXKjnx8FtkiTbd4XbXN0Nucs42pfoqEGeN/81454Honi6G9ElKTXOS2Pxfc8NVQK70/cJ X-Received: by 2002:a17:902:ce8c:b0:156:c7f5:10f8 with SMTP id f12-20020a170902ce8c00b00156c7f510f8mr1123887plg.47.1649123265717; Mon, 04 Apr 2022 18:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649123265; cv=none; d=google.com; s=arc-20160816; b=0E5Cx4W/3ZYXhfkpkV38RH3gWIXmEnW9A/9njoayO9iselL5LSObvEGz4X+GCMnmJF ik67kPo0Ol6Z9f4ddYXhJ/tZ1yTxZfB3Fbpyjq1BpplEshdYGEQCtwDfL1RQeHPM604l Pv8XFF/YpHKo8mWBcohcEz1X+nT9LoHwhPrl1Up8dWCJOSUQuDgvGe9epId28nr6Ekfn DDHHD4wGWt7YwPRm1BsBoSs9wSpYB2jiySYYOukCkBqDIY8iepW08h1gLsFJS7sHti4q rHV/Z2rwxbPAvIJuwFieNoyu84G96XvRvYFNAt1Cq0tuPi6NtnuySJD81T9DJXXEtbv0 7DTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BrSrrflOnOxW98Y+PJdfMuaXFi/+nplcn+rrvtZ8GN8=; b=fSvi8Cnyi2b9s0XvT/uKzYwiq3RwImSKi0+L7fnJorQXOp0HtLUdDcwqL/Q+RcLGc2 G3YG8eyCI5SPoTOUhyrs9a/Yi1pR96JCdN4Yf0mo6b24rLxJxSYlLkAVuBBEcazreV3b Q/KzheM9LxzrqMPINYNweF7/r9QUia0obEgqk+X/zi0IbUecSNDNnUGR9aeWhSsk54jm 4QRcqZAm3b7e7KRAYAwJnpDrvMUzdTjwgwI9ALjtB4pIJuU/sCWzmkz+pFcd2dIV/mXS gVhkjkbocTF/E8hPhW2mvlNcb3azXT0JGsMD+qWyRMLbNufIH9l5dBp2N9ZJDDQ4pmJs V4KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IX/G6zEz"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h6-20020a170902f70600b0015679fc876dsi8343029plo.160.2022.04.04.18.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:47:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IX/G6zEz"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 084F12428A3; Mon, 4 Apr 2022 17:48:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239258AbiDBIZp (ORCPT + 99 others); Sat, 2 Apr 2022 04:25:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239213AbiDBIZp (ORCPT ); Sat, 2 Apr 2022 04:25:45 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8BF14F460; Sat, 2 Apr 2022 01:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648887833; x=1680423833; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Gnc7Vq8A0AMWRP1SecSxWIcpYauRkoVdUdGm+VQNnk4=; b=IX/G6zEz1qzhXNMY22Xpsdpu2uU0a48uSYEQ3oELiDYmDqplvsdN2ib+ UgOOimYRSItO9PRLZQLeOQGE9x5OTse6SKsvIJ+G6+UN+bkTMsq95kZDG MNSPk/IihmpNOMFo5csCeAy1rqbUL+I0CYDouBrORFzhTIgYqEez4jFAS KwV/mGnyqP00/k6zmVm/8yCtOuOrykdZufWTVs+O4nqyozQ+Ln4zISNAG eQRENExaXXJlSBUIwocO9O1bpmIpSGS149APlcp3qFkynHqXtJpcgF9nc JMaIaDxQtuNgIuydGWHYJwRCJBoCVOxwlpPgp5RJ2lkix2tgVrebzrldr g==; X-IronPort-AV: E=McAfee;i="6200,9189,10304"; a="240225766" X-IronPort-AV: E=Sophos;i="5.90,229,1643702400"; d="scan'208";a="240225766" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2022 01:23:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,229,1643702400"; d="scan'208";a="587101927" Received: from lkp-server02.sh.intel.com (HELO 3231c491b0e2) ([10.239.97.151]) by orsmga001.jf.intel.com with ESMTP; 02 Apr 2022 01:23:50 -0700 Received: from kbuild by 3231c491b0e2 with local (Exim 4.95) (envelope-from ) id 1naZ2z-00025L-9v; Sat, 02 Apr 2022 08:23:49 +0000 Date: Sat, 2 Apr 2022 16:22:56 +0800 From: kernel test robot To: Corentin Labbe , heiko@sntech.de, herbert@gondor.apana.org.au, krzk+dt@kernel.org, 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 v4 10/33] crypto: rockchip: rework by using crypto_engine Message-ID: <202204021634.IhyHrjoT-lkp@intel.com> References: <20220401201804.2867154-11-clabbe@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220401201804.2867154-11-clabbe@baylibre.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Corentin, I love your patch! Perhaps something to improve: [auto build test WARNING on next-20220331] [also build test WARNING on v5.17] [cannot apply to rockchip/for-next herbert-cryptodev-2.6/master herbert-crypto-2.6/master v5.17 v5.17-rc8 v5.17-rc7] [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/intel-lab-lkp/linux/commits/Corentin-Labbe/crypto-rockchip-permit-to-pass-self-tests/20220402-042221 base: fdcbcd1348f4ef713668bae1b0fa9774e1811205 config: arm64-buildonly-randconfig-r001-20220402 (https://download.01.org/0day-ci/archive/20220402/202204021634.IhyHrjoT-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c4a1b07d0979e7ff20d7d541af666d822d66b566) 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/intel-lab-lkp/linux/commit/be381eb03ba20a6e06f0e880a9929d14a1e13064 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Corentin-Labbe/crypto-rockchip-permit-to-pass-self-tests/20220402-042221 git checkout be381eb03ba20a6e06f0e880a9929d14a1e13064 # 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:21:46: error: use of undeclared identifier 'tfm' unsigned int bs = crypto_skcipher_blocksize(tfm); ^ >> drivers/crypto/rockchip/rk3288_crypto_skcipher.c:328:6: warning: variable 'n' set but not used [-Wunused-but-set-variable] int n = 0; ^ 1 warning and 1 error generated. vim +/n +328 drivers/crypto/rockchip/rk3288_crypto_skcipher.c 319 320 static int rk_cipher_run(struct crypto_engine *engine, void *async_req) 321 { 322 struct skcipher_request *areq = container_of(async_req, struct skcipher_request, base); 323 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq); 324 struct rk_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); 325 struct rk_cipher_rctx *rctx = skcipher_request_ctx(areq); 326 struct scatterlist *sgs, *sgd; 327 int err = 0; > 328 int n = 0; 329 int ivsize = crypto_skcipher_ivsize(tfm); 330 int offset; 331 u8 iv[AES_BLOCK_SIZE]; 332 u8 biv[AES_BLOCK_SIZE]; 333 u8 *ivtouse = areq->iv; 334 unsigned int len = areq->cryptlen; 335 unsigned int todo; 336 337 ivsize = crypto_skcipher_ivsize(tfm); 338 if (areq->iv && crypto_skcipher_ivsize(tfm) > 0) { 339 if (rctx->mode & RK_CRYPTO_DEC) { 340 offset = areq->cryptlen - ivsize; 341 scatterwalk_map_and_copy(rctx->backup_iv, areq->src, 342 offset, ivsize, 0); 343 } 344 } 345 346 sgs = areq->src; 347 sgd = areq->dst; 348 349 while (sgs && sgd && len) { 350 if (!sgs->length) { 351 sgs = sg_next(sgs); 352 sgd = sg_next(sgd); 353 continue; 354 } 355 if (rctx->mode & RK_CRYPTO_DEC) { 356 /* we backup last block of source to be used as IV at next step */ 357 offset = sgs->length - ivsize; 358 scatterwalk_map_and_copy(biv, sgs, offset, ivsize, 0); 359 } 360 if (sgs == sgd) { 361 err = dma_map_sg(ctx->dev->dev, sgs, 1, DMA_BIDIRECTIONAL); 362 if (err <= 0) { 363 err = -EINVAL; 364 goto theend_iv; 365 } 366 } else { 367 err = dma_map_sg(ctx->dev->dev, sgs, 1, DMA_TO_DEVICE); 368 if (err <= 0) { 369 err = -EINVAL; 370 goto theend_iv; 371 } 372 err = dma_map_sg(ctx->dev->dev, sgd, 1, DMA_FROM_DEVICE); 373 if (err <= 0) { 374 err = -EINVAL; 375 goto theend_sgs; 376 } 377 } 378 err = 0; 379 rk_ablk_hw_init(ctx->dev, areq); 380 if (ivsize) { 381 if (ivsize == DES_BLOCK_SIZE) 382 memcpy_toio(ctx->dev->reg + RK_CRYPTO_TDES_IV_0, ivtouse, ivsize); 383 else 384 memcpy_toio(ctx->dev->reg + RK_CRYPTO_AES_IV_0, ivtouse, ivsize); 385 } 386 reinit_completion(&ctx->dev->complete); 387 ctx->dev->status = 0; 388 389 todo = min(sg_dma_len(sgs), len); 390 len -= todo; 391 crypto_dma_start(ctx->dev, sgs, sgd, todo / 4); 392 wait_for_completion_interruptible_timeout(&ctx->dev->complete, 393 msecs_to_jiffies(2000)); 394 if (!ctx->dev->status) { 395 dev_err(ctx->dev->dev, "DMA timeout\n"); 396 err = -EFAULT; 397 goto theend; 398 } 399 if (sgs == sgd) { 400 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_BIDIRECTIONAL); 401 } else { 402 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_TO_DEVICE); 403 dma_unmap_sg(ctx->dev->dev, sgd, 1, DMA_FROM_DEVICE); 404 } 405 if (rctx->mode & RK_CRYPTO_DEC) { 406 memcpy(iv, biv, ivsize); 407 ivtouse = iv; 408 } else { 409 offset = sgd->length - ivsize; 410 scatterwalk_map_and_copy(iv, sgd, offset, ivsize, 0); 411 ivtouse = iv; 412 } 413 sgs = sg_next(sgs); 414 sgd = sg_next(sgd); 415 n++; 416 } 417 418 if (areq->iv && ivsize > 0) { 419 offset = areq->cryptlen - ivsize; 420 if (rctx->mode & RK_CRYPTO_DEC) { 421 memcpy(areq->iv, rctx->backup_iv, ivsize); 422 memzero_explicit(rctx->backup_iv, ivsize); 423 } else { 424 scatterwalk_map_and_copy(areq->iv, areq->dst, offset, 425 ivsize, 0); 426 } 427 } 428 429 theend: 430 local_bh_disable(); 431 crypto_finalize_skcipher_request(engine, areq, err); 432 local_bh_enable(); 433 return 0; 434 435 theend_sgs: 436 if (sgs == sgd) { 437 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_BIDIRECTIONAL); 438 } else { 439 dma_unmap_sg(ctx->dev->dev, sgs, 1, DMA_TO_DEVICE); 440 dma_unmap_sg(ctx->dev->dev, sgd, 1, DMA_FROM_DEVICE); 441 } 442 theend_iv: 443 return err; 444 } 445 -- 0-DAY CI Kernel Test Service https://01.org/lkp