Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3906609pxf; Tue, 16 Mar 2021 00:15:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxakLQU3BxaPcr/yFomq/16sAH0iFm329hsbjpHYXW/SYWs50KYgGjsuflFbWwtvcxaxSt2 X-Received: by 2002:a17:906:7842:: with SMTP id p2mr8370106ejm.87.1615878919333; Tue, 16 Mar 2021 00:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615878919; cv=none; d=google.com; s=arc-20160816; b=o9CrDJe4jZIy38SYwmi59c/nrcvBAOyIx/2t3fn9tdlCPo/MUil75oatAN2P3FuRbz ycfSt6VuGowoDY8GTvxvSKGODem2uEN75SqLMAscqKYt8cI29MD5NchU6CnR5RosiZa9 451jXLsXUzdn6DOYgF5qi/ZwrGBmpT3vc9Wu9nhqOsJIUI09rMLXUh0OVacF93eazXAB vrbBNv903k9DpOT7O9+XO4Z1mXVpp1KK3OTsJgh7kSYmz9WaL4wOWfQI/uuZsjL7EwZ3 zC/oplqHmiMB3Fr2fMbYb9adpWOPnDXzfooOPgZnvfsGabTFsjS4VpXPaUOt5IWH+tzd NbXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=X5iAa6Nuz7ymWx1S0OfS+jitn2Mhq2x08JbgDDa9FUo=; b=pHpKZtkI4t5fOOg/rtcZ2nEsVLU/RPv8LjAJVBar6RmyUUHzRnttv2bIg9PwCclCrl +gyAlFzr1qzWmMj7IhUUxaUZUSbBIQUHzW5EBlMUlkptOYhmdHkE9LgWxn1ldjOmOoye 5HeDtaQ8ibzgf7MTTInF48YkVZJzmUJKxUgFIwlfBu/C6ORkwUGiJc5WdO+ngW6lrtNS EZE1ZszLJecfVsJXs6HPpK1AIMpk5bGMg+jO4oAB7vUZ5OuFkHs7ikunPdMDBsvYUC9V QJMwU38jKfGMqnwYi8cKbYr24uV7fmnlJMGaQ/+Cb0IHyIzPSYJotf/E7Ae8ggvOyRPP +N1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si12679452edw.62.2021.03.16.00.14.49; Tue, 16 Mar 2021 00:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233801AbhCPB7y (ORCPT + 99 others); Mon, 15 Mar 2021 21:59:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13618 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233878AbhCPB7v (ORCPT ); Mon, 15 Mar 2021 21:59:51 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DzxJK4ds7z17LlX; Tue, 16 Mar 2021 09:57:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Tue, 16 Mar 2021 09:59:35 +0800 From: chenxiang To: , , , , CC: , , Xiang Chen Subject: [PATCH v2 0/4] Fix the parameter of dma_map_sg() Date: Tue, 16 Mar 2021 09:55:22 +0800 Message-ID: <1615859726-57062-1-git-send-email-chenxiang66@hisilicon.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Xiang Chen According to Documentation/core-api/dma-api-howto.rst, the parameters of dma_unmap_sg() must be the same as those which are passed in to the scatter/gather mapping API. But for some drivers under crypto, the parameter of dma_unmap_sg() is number of elements after mapping. So fix them. Part of the document is as follows: To unmap a scatterlist, just call:: dma_unmap_sg(dev, sglist, nents, direction); Again, make sure DMA activity has already finished. .. note:: The 'nents' argument to the dma_unmap_sg call must be the _same_ one you passed into the dma_map_sg call, it should _NOT_ be the 'count' value _returned_ from the dma_map_sg call. Change Log: v1 -> v2: Remove changing the count passed to create_sg_component in driver cavium; Xiang Chen (4): crypto: amlogic - Fix the parameter of dma_unmap_sg() crypto: cavium - Fix the parameter of dma_unmap_sg() crypto: ux500 - Fix the parameter of dma_unmap_sg() crypto: allwinner - Fix the parameter of dma_unmap_sg() drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 9 ++++++--- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 ++- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 9 ++++++--- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 ++- drivers/crypto/amlogic/amlogic-gxl-cipher.c | 6 +++--- drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 9 +++++---- drivers/crypto/ux500/cryp/cryp_core.c | 4 ++-- drivers/crypto/ux500/hash/hash_core.c | 2 +- 8 files changed, 27 insertions(+), 18 deletions(-) -- 2.8.1