提交 1e320410 编写于 作者: M Mogens Lauridsen 提交者: Herbert Xu

crypto: sahara - Fix dma unmap direction

The direction used in dma_unmap_sg in aes calc is wrong.
This result in the cache not being invalidated correct when aes
calculation is done and result has been dma'ed to memory.
This is seen as sporadic wrong result from aes calc.
Signed-off-by: NMogens Lauridsen <mlauridsen171@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 2d97591e
...@@ -543,10 +543,10 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev) ...@@ -543,10 +543,10 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
unmap_out: unmap_out:
dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg, dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg,
DMA_TO_DEVICE); DMA_FROM_DEVICE);
unmap_in: unmap_in:
dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg, dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
DMA_FROM_DEVICE); DMA_TO_DEVICE);
return -EINVAL; return -EINVAL;
} }
...@@ -594,9 +594,9 @@ static int sahara_aes_process(struct ablkcipher_request *req) ...@@ -594,9 +594,9 @@ static int sahara_aes_process(struct ablkcipher_request *req)
} }
dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg, dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg,
DMA_TO_DEVICE);
dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
DMA_TO_DEVICE);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册