Patchwork crypto: ccp - unmap pages and remove unmap objects in callback

login
register
mail settings
Submitter Gary R Hook
Date Sept. 5, 2017, 10:01 p.m.
Message ID <20170905220150.28464.76800.stgit@taos.amd.com>
Download mbox | patch
Permalink /patch/9939679/
State Accepted
Delegated to: Herbert Xu
Headers show

Comments

Gary R Hook - Sept. 5, 2017, 10:01 p.m.
From: amd <amd@sosxen2.amd.com>

Clean up the mapped pages and the unmap object once we are done with
it. This enables the final clean-up of the object once the transfer
is complete.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
---
 drivers/crypto/ccp/ccp-dmaengine.c |    1 +
 1 file changed, 1 insertion(+)
Herbert Xu - Oct. 7, 2017, 4:18 a.m.
On Tue, Sep 05, 2017 at 05:01:51PM -0500, Gary R Hook wrote:
> From: amd <amd@sosxen2.amd.com>
> 
> Clean up the mapped pages and the unmap object once we are done with
> it. This enables the final clean-up of the object once the transfer
> is complete.
> 
> Signed-off-by: Gary R Hook <gary.hook@amd.com>

Patch applied.  Thanks.

Patch

diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c
index 901343dd513e..e01b08a28ce5 100644
--- a/drivers/crypto/ccp/ccp-dmaengine.c
+++ b/drivers/crypto/ccp/ccp-dmaengine.c
@@ -223,6 +223,7 @@  static struct ccp_dma_desc *ccp_handle_active_desc(struct ccp_dma_chan *chan,
 				desc->tx_desc.cookie, desc->status);
 
 			dma_cookie_complete(tx_desc);
+			dma_descriptor_unmap(tx_desc);
 		}
 
 		desc = __ccp_next_dma_desc(chan, desc);