Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp271724pxb; Mon, 8 Feb 2021 23:05:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyo7iXOdexDccEAm2/jTg4xdP/C/Vv7tl8otyvSYZayAp0zh81cboIYNPsWZZ+79WWoqlUz X-Received: by 2002:a17:906:ae50:: with SMTP id lf16mr21374314ejb.66.1612854321324; Mon, 08 Feb 2021 23:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612854321; cv=none; d=google.com; s=arc-20160816; b=xEk1v2rQX4WGG+8D02ZauLnychZkWp4cPw9T5TB0zEds5fpqiQyviACzHCnqSZXtaI 338hI2qwJrF11rfLksf1+WIk1V6+8IGuhOfbYldwAqoErYYSVcnrPn9+HGIJosI8XKOI EnG1KnfQJX+aBrLpBEjvg+RAOdvo4xlz1y3VdGL3CwBGuyyOYrPQHm+n+t0zCxiQ1NuM Eklk9upc1QmAvNmsjtxZMAxN4gkhXBrk1f1kBJoEnNuENPpp9k+uEIBqfKNH+ISpsUG+ lU+hl8Eriufym8NjxzSDZ3tQvGKNpcgvS6q551gzYCYqrxocJ/4ffo3oxeHOE9elKAUU WbtA== 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=dcYN2EjOXAwkefheNNL62MvJB83p/hmGE3Lx1572QVY=; b=NwUaIByZTX3kJFB1b9bxeGxl0375Qa8U4MjEpwkxJ1yblYqkZLf7mdSSo8ov1onDyf 7KAhIk+XUxk3dywK0Qd7aVdjTm0iHfwrjhIboGCT46KDh5Rw+hNlD2vjBeqlw+OFVrpY nW9JlGigUkkHoxuonqGbVuWchI9GjsuCalFndoOdZlZEbBtyW1Dp4IOxCwOWdZQoHNpG 4aWmb5x/A8mKYIsrYQDa4vr7f82s6s5+Ftumj4tcOuxuDM3odUWiocFRSrAuSuNtRvCM jSPb+f88VQDamemH0Qbzb0TFk3G1YcAqjgYC5iBpq4cMmDcRenvUapRJsgUIkwS6k8eq SXcQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jj13si32136ejc.60.2021.02.08.23.04.45; Mon, 08 Feb 2021 23:05:21 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbhBIHEd (ORCPT + 99 others); Tue, 9 Feb 2021 02:04:33 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11714 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhBIHEd (ORCPT ); Tue, 9 Feb 2021 02:04:33 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DZYjT3cZnzlJ12; Tue, 9 Feb 2021 15:02:05 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Tue, 9 Feb 2021 15:03:30 +0800 From: chenxiang To: , , , , CC: , , , Xiang Chen Subject: [PATCH 0/4] Fix the parameter of dma_map_sg() Date: Tue, 9 Feb 2021 14:59:21 +0800 Message-ID: <1612853965-67777-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. chenxiang (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 | 8 ++++---- drivers/crypto/ux500/cryp/cryp_core.c | 4 ++-- drivers/crypto/ux500/hash/hash_core.c | 2 +- 8 files changed, 26 insertions(+), 18 deletions(-) -- 2.8.1