Thread (6 messages) read the whole thread 6 messages, 2 authors, 2021-03-26

Re: [PATCH v2 0/4] Fix the parameter of dma_map_sg()

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2021-03-26 09:30:48

On Tue, Mar 16, 2021 at 09:55:22AM +0800, chenxiang wrote:
From: Xiang Chen <redacted>

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 <nents> 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(-)
All applied.  Thanks.
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help