Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp424735ybg; Sat, 26 Oct 2019 00:33:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWShk2J3JRLI9yqUxJMBJRAUL8hB2S82gmJZ8MnGx8Y19gCHtpGlO+7LnN3t+onrwbx7ph X-Received: by 2002:a17:906:48c5:: with SMTP id d5mr580248ejt.167.1572075207425; Sat, 26 Oct 2019 00:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572075207; cv=none; d=google.com; s=arc-20160816; b=IsoeP53K/Rw3wCgHbOkqsomljocEKu/0t2LMolKkRysAfqDD2XYNBFcvUDCN5OIdPg RJgx1/uU6C+wZ4mV6xMFbJ5fxsamr7JhNllLFHyuVXpyXJ1AykaTh46uWPNCdQQC6kFM VLZNq9iCp82tw5FOQhtWuQ52UwohZ/nLLyN2qddiWTfVRcJ+QrnG/xk4qNz++XTaCoQ3 PchQhjxxY+Bukafd9AU05kMbXc/5nVXdA9RyVXz5AGfneD7yxG9qWMxJFSLAY0f8HdoP Arksp36qhVdG9pv9JH1ZIbMPu01hmKTpVT0+lGFn2kbscNI7mj7S6mQJvYnCEIda6lsH 4EIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dtyBaARQzyWYqzK+keiEY0eULHl/XmtLTqCIKdR+ZNo=; b=jvf9p3GlT9kEiLugetjaPff0qLGyTqeetN8M4hvQ1BZMR95/07sKhsYLPRE6HZ+MOo rQEzQ9C1tkyNOyJ1NNffWCRY3Ttx9OCqHCWCCSDRSo3A+YjkoL3cw/H5pLbxdLNsJIKD miXAoV2lQudjydQm5SH6g1grzNFvM+liOYi/X6vHb5pKf55a4RPKuL34IwGeNCA4z60V Gis01a+FtmPoQP/YwQCppXeo5ZnCyA8N/ZUqZPy/L2WgxMaOqKmlCgcUlQRrZCZhLBkQ LCCqlttDB/m2fH5ScfkcOLQwHd/evTTLD7zEd6Mj37j4U3pko4gS+4DxcSSOjimbe+55 fAlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EVZyemV8; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si2759251ejz.77.2019.10.26.00.32.48; Sat, 26 Oct 2019 00:33:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EVZyemV8; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725996AbfJZHca (ORCPT + 99 others); Sat, 26 Oct 2019 03:32:30 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36036 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbfJZHca (ORCPT ); Sat, 26 Oct 2019 03:32:30 -0400 Received: by mail-wr1-f67.google.com with SMTP id w18so4741693wrt.3 for ; Sat, 26 Oct 2019 00:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dtyBaARQzyWYqzK+keiEY0eULHl/XmtLTqCIKdR+ZNo=; b=EVZyemV8ZX09sKSvdOvQGp87E/TzTsA0jljxX1tfZfX/S3gMixnGz/iw1S2c/37oKE FYZOtd2B18msQDsGlQQdtwvJsS9wNAIA8lm0xsjpaIwgZmK6eJGFwFszkQiYpaAIb3yc Z/tAeNPo1BKt2NisgitYpZPD2VMSu6vW2bl6dDU0z9NgJB5Hd5TuITQbyZCoXl6qq2Rh o3YOT5ixZ5q2Mv6f91+/yZuJP+UbWNyc87FLwqStv6cneobi0XHaOnNbzsaB0MUJRfY7 6QrL1j1WHxfJJJfQ+meefiJxuRu4qi1M3y+5gksJJ96fMlvAvwmv5X6L794iKeRs6p8H tgMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dtyBaARQzyWYqzK+keiEY0eULHl/XmtLTqCIKdR+ZNo=; b=sLiNKni6UpNmp9/x9xqL7zneb1Q7149GliOhXtCss6pi5oWCx5qAyQs9HwqieIHSXU f1zmhGR8pumVirnmMk0qz8uHyYMGk3eX5odDxSytkycnKe3XBpQaL5GK98INZPmoPdyg f916OSGKx1t7xvHnoT3C4tVHa24lmnxQmi/NVmX98KUJuTXASA5/asKqTq7VIkw7KIzq J5ztrqA0rUXom1Vl+Q40EiyCejSWomFqcL4wuXN4694Cx1T4M4hBc3Oi+gt6p4GvFyQM Km8VDcVgD+6jIYIDI5r8Kk8BZfPG5kKaiRJ56hoLkdgU1OYloW9y0PmP/ktTDbWG1L5x 2XPQ== X-Gm-Message-State: APjAAAXFTJbEepc69RaLG56lOhFGiBqD0Wdg1/nAJ9OLEcs+dguW2cQ2 Oj4vH7AIqUnf6wyH5Im2VpCaRKtUN+HF1Z815y2JBw== X-Received: by 2002:adf:f685:: with SMTP id v5mr6658668wrp.246.1572075147381; Sat, 26 Oct 2019 00:32:27 -0700 (PDT) MIME-Version: 1.0 References: <1572058641-173376-1-git-send-email-wangzhou1@hisilicon.com> In-Reply-To: <1572058641-173376-1-git-send-email-wangzhou1@hisilicon.com> From: Ard Biesheuvel Date: Sat, 26 Oct 2019 09:32:25 +0200 Message-ID: Subject: Re: [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len To: Zhou Wang Cc: Herbert Xu , "David S. Miller" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, 26 Oct 2019 at 05:01, Zhou Wang wrote: > > Use sgl API to get sgl dma addr and len, this will help to avoid compile > error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which > can only be selected by arch code. > > Signed-off-by: Zhou Wang > Suggested-by: Herbert Xu Acked-by: Ard Biesheuvel > --- > drivers/crypto/hisilicon/Kconfig | 1 - > drivers/crypto/hisilicon/sgl.c | 4 ++-- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig > index a71f2bf..82fb810d 100644 > --- a/drivers/crypto/hisilicon/Kconfig > +++ b/drivers/crypto/hisilicon/Kconfig > @@ -18,7 +18,6 @@ config CRYPTO_DEV_HISI_QM > tristate > depends on ARM64 || COMPILE_TEST > depends on PCI && PCI_MSI > - select NEED_SG_DMA_LENGTH > help > HiSilicon accelerator engines use a common queue management > interface. Specific engine driver may use this module. > diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c > index bf72603..012023c 100644 > --- a/drivers/crypto/hisilicon/sgl.c > +++ b/drivers/crypto/hisilicon/sgl.c > @@ -164,8 +164,8 @@ static struct hisi_acc_hw_sgl *acc_get_sgl(struct hisi_acc_sgl_pool *pool, > static void sg_map_to_hw_sg(struct scatterlist *sgl, > struct acc_hw_sge *hw_sge) > { > - hw_sge->buf = sgl->dma_address; > - hw_sge->len = cpu_to_le32(sgl->dma_length); > + hw_sge->buf = sg_dma_address(sgl); > + hw_sge->len = cpu_to_le32(sg_dma_len(sgl)); > } > > static void inc_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl) > -- > 2.8.1 >