Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp1300473pxw; Sat, 9 Apr 2022 19:12:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPTnezJkKY8dTLhvhshpqlhMG5vr14OYeBpMVBdXOr5G9w8vo/trGGuidSMroHhySE21of X-Received: by 2002:a17:90b:2385:b0:1cb:74f7:6517 with SMTP id mr5-20020a17090b238500b001cb74f76517mr3518975pjb.142.1649556772785; Sat, 09 Apr 2022 19:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649556772; cv=none; d=google.com; s=arc-20160816; b=lc+5Hmu3OZevG27IdW66xSCf8rmlOy9xReoprj35o9mvisR1xgE4amd95wDRRM2ZNw 4UkuZk/cLKuQzTIF+d9O/C8EyKkYdz56e46JWy5fQHrhTmKsZ5xxxEj3Hg2+SjZkBqhv Spf20Oy+++WwTx5PbJY6VNbSmShDIyaxjVvS3WB6WRSdSgQ+HSYnEAPJZ7gqdoo6FL3F moioWDaxzWZw70Fe+U+ArT5cfO8A9fUwGUrLg8lzQp1aOUWXd4RL5PCBQVrUInm9IZC9 p0GgiFy6ZYldz2ZFPpoXBOjnmVwmJhuikqA3FkOY8lyr0DnDuT4DtmypaVTHx13rZCfz kONw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=stsdDN5iR/eA2aqMLX8Q4/ho+XJzT+rtKsITwQhdh5c=; b=FYYTB+aNceddt+nzcw1FZC3pCcI8FiFJzqf/FGpzNOsXKIE1/36HGD7jcETjx31j7E MHRuESPRiERw9AzUJGTGX/2nSRCoUWuKf04j3BQN50nEMsHYH23gV4YcZZmLJN9wO43w 9+RsSwxNiUH3HBCZAZlshbdo+47LtpojybYfD+nP1vLVldHdAbMuhw+H2230yEleul1A BquDkZ1s7Upnr9CWObuu3O5Ux55D+W5G0mehEOMTxMhW12RsdnmQuCuZJWY8VBZEwcaG lWlK5ziBFadExHWcNJbJfRIZbGFYvxHAsXb9Aib4FkUM1JVlNBhzMBNlRd0oU8AteKt/ nuFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a633114000000b0039cb1232e71si5494507pgx.403.2022.04.09.19.12.20; Sat, 09 Apr 2022 19:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241429AbiDIJhH (ORCPT + 99 others); Sat, 9 Apr 2022 05:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241311AbiDIJhD (ORCPT ); Sat, 9 Apr 2022 05:37:03 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4623D23EC7F; Sat, 9 Apr 2022 02:34:45 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kb8z95pl0zDq8C; Sat, 9 Apr 2022 17:32:21 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 9 Apr 2022 17:34:42 +0800 Received: from localhost.localdomain (10.67.164.66) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 9 Apr 2022 17:34:41 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH] crypto: hisilicon/sgl - align the hardware sgl dma address Date: Sat, 9 Apr 2022 17:33:09 +0800 Message-ID: <20220409093309.55715-1-shenyang39@huawei.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 The hardware needs aligned sgl dma address. So expend the sgl_size to align 64 bytes. Signed-off-by: Yang Shen --- drivers/crypto/hisilicon/sgl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c index f7efc02b065f..2b6f2281cfd6 100644 --- a/drivers/crypto/hisilicon/sgl.c +++ b/drivers/crypto/hisilicon/sgl.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2019 HiSilicon Limited. */ +#include #include #include #include @@ -64,8 +65,9 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev, if (!dev || !count || !sge_nr || sge_nr > HISI_ACC_SGL_SGE_NR_MAX) return ERR_PTR(-EINVAL); - sgl_size = sizeof(struct acc_hw_sge) * sge_nr + - sizeof(struct hisi_acc_hw_sgl); + sgl_size = ALIGN(sizeof(struct acc_hw_sge) * sge_nr + + sizeof(struct hisi_acc_hw_sgl), + HISI_ACC_SGL_ALIGN_SIZE); /* * the pool may allocate a block of memory of size PAGE_SIZE * 2^(MAX_ORDER - 1), -- 2.24.0