diff options
author | Ryder Lee <ryder.lee@mediatek.com> | 2017-01-20 13:41:09 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-01-23 22:50:29 +0800 |
commit | 4432861fb9747fce52f94bc13da0d9b41292ef69 (patch) | |
tree | 5fb79adb5e88a5825f825f5043761b3ac16df390 /drivers/crypto/mediatek/mtk-platform.h | |
parent | a873996238e4019c54c49b56fcc1fef35a93da41 (diff) | |
download | blackbird-op-linux-4432861fb9747fce52f94bc13da0d9b41292ef69.tar.gz blackbird-op-linux-4432861fb9747fce52f94bc13da0d9b41292ef69.zip |
crypto: mediatek - fix incorrect data transfer result
This patch fixes mtk_aes_xmit() data transfer bug.
The original function uses the same loop and ring->pos
to handle both command and result descriptors. But this
produces incomplete results when src.sg_len != dst.sg_len.
To solve the problem, we splits the descriptors into different
loops and uses cmd_pos and res_pos to record them respectively.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/mediatek/mtk-platform.h')
-rw-r--r-- | drivers/crypto/mediatek/mtk-platform.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/mediatek/mtk-platform.h b/drivers/crypto/mediatek/mtk-platform.h index 1516786b7a02..8c50b74788ff 100644 --- a/drivers/crypto/mediatek/mtk-platform.h +++ b/drivers/crypto/mediatek/mtk-platform.h @@ -83,9 +83,10 @@ struct mtk_desc { * struct mtk_ring - Descriptor ring * @cmd_base: pointer to command descriptor ring base * @cmd_dma: DMA address of command descriptor ring + * @cmd_pos: current position in the command descriptor ring * @res_base: pointer to result descriptor ring base * @res_dma: DMA address of result descriptor ring - * @pos: current position in the ring + * @res_pos: current position in the result descriptor ring * * A descriptor ring is a circular buffer that is used to manage * one or more descriptors. There are two type of descriptor rings; @@ -94,9 +95,10 @@ struct mtk_desc { struct mtk_ring { struct mtk_desc *cmd_base; dma_addr_t cmd_dma; + u32 cmd_pos; struct mtk_desc *res_base; dma_addr_t res_dma; - u32 pos; + u32 res_pos; }; /** |