From: Horia Geantă Date: Mon, 6 Aug 2018 12:29:09 +0000 (+0300) Subject: crypto: caam/jr - fix descriptor DMA unmapping X-Git-Tag: v4.9.126~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac617410962fcdd6b4675865a4469a8a54abb584;p=platform%2Fkernel%2Flinux-amlogic.git crypto: caam/jr - fix descriptor DMA unmapping commit cc98963dbaaea93d17608641b8d6942a5327fc31 upstream. Descriptor address needs to be swapped to CPU endianness before being DMA unmapped. Cc: # 4.8+ Fixes: 261ea058f016 ("crypto: caam - handle core endianness != caam endianness") Reported-by: Laurentiu Tudor Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index 9e7f281..6d475a2 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c @@ -189,7 +189,8 @@ static void caam_jr_dequeue(unsigned long devarg) BUG_ON(CIRC_CNT(head, tail + i, JOBR_DEPTH) <= 0); /* Unmap just-run descriptor so we can post-process */ - dma_unmap_single(dev, jrp->outring[hw_idx].desc, + dma_unmap_single(dev, + caam_dma_to_cpu(jrp->outring[hw_idx].desc), jrp->entinfo[sw_idx].desc_size, DMA_TO_DEVICE);