From patchwork Sat Oct 26 02:57:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhou Wang X-Patchwork-Id: 177801 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp378828ill; Fri, 25 Oct 2019 20:01:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyop0c+cfWb9wD+kNErVRXgMocUSwweCxX53CdXsPIGZQ3U6Fx7lh7q8FbJcbHLulE0TkfD X-Received: by 2002:a17:907:4451:: with SMTP id mw1mr6648136ejb.209.1572058892981; Fri, 25 Oct 2019 20:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572058892; cv=none; d=google.com; s=arc-20160816; b=0rN336Hb0csrf0KYYZozLgEIsk9LjySv6HhdLQBXQfTTrRVyTMkYncr3xlM0MQF/bU 1s4DXtcfRDLx8r1Ppixe85BixE2xPlzEw3ad1I7NOHQwH0rXFixUGu9ITyQG92cezh2E 82PZ1GGSgQUk3lygEPYmpJi89z/Lk4nzATxAPWbeqV6CpF3I1v/7iogLcfLwfnOymQiM 5Air3ZklKslAC4x2lfWRcA2vZ8zi9+p62EIyzx8FZTID0VOlIe42IxDR3hkNOrG4xAxH 4ql1HHqZzaW4+zRgfYKg4Au4vRCYuHLZqQiF63h7kzf1fbtuY9WqHX+polYZC/lFzMPI UdIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=jzUhOibosUuZYSZJZYHOYx9Kn2E2cbga5yOg0rHzIhQ=; b=LbEmgUoZc7iy2uOlBY1I5Gh8y1IPePpGD+jdEjXus1pk+2/vrcypzcEh0xUe7infq+ P2F9UtvKaryenieZXS9hBYYixtE3u7qJ6U7yXYod1wMbIwYKQFZboDHv81eW5x/nSdo1 DQJ7V2kbrgZ4EgbZiO19cMHq8BRls0HjSkJgsAKehWhhwUl/GqYUHGeBD4o+7un1qwz6 Akskbspn3HresKeh2rAjrZogmcTksm5/PSwF5aHInpFaC2zs17wnhPit2n/za0XVPlRZ DqVs97h3K+fhdRPIJ6Eefhfr75/tvFDTogqVav/Ls9RVGLqy/MzqSLVq1iwpq3Zq4Q3t gdEg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a30si2671046eda.39.2019.10.25.20.01.32; Fri, 25 Oct 2019 20:01:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725997AbfJZDB2 (ORCPT + 3 others); Fri, 25 Oct 2019 23:01:28 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33558 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725957AbfJZDB2 (ORCPT ); Fri, 25 Oct 2019 23:01:28 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 505A5BCBC53AA533256D; Sat, 26 Oct 2019 11:01:25 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Sat, 26 Oct 2019 11:01:18 +0800 From: Zhou Wang To: Herbert Xu , "David S. Miller" CC: , Zhou Wang Subject: [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len Date: Sat, 26 Oct 2019 10:57:21 +0800 Message-ID: <1572058641-173376-1-git-send-email-wangzhou1@hisilicon.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/hisilicon/Kconfig | 1 - drivers/crypto/hisilicon/sgl.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) -- 2.8.1 Acked-by: Ard Biesheuvel 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)