crypto: stm32/hash - rework padding length

Due to another patch, the dma fails when padding is
needed as the given length is not correct.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Lionel Debieve 2018-01-29 15:28:11 +01:00 committed by Herbert Xu
parent ff1cae4e7f
commit d03d29bd18
1 changed files with 1 additions and 1 deletions

View File

@ -627,7 +627,7 @@ static int stm32_hash_dma_send(struct stm32_hash_dev *hdev)
writesl(hdev->io_base + HASH_DIN, buffer, writesl(hdev->io_base + HASH_DIN, buffer,
DIV_ROUND_UP(ncp, sizeof(u32))); DIV_ROUND_UP(ncp, sizeof(u32)));
} }
stm32_hash_set_nblw(hdev, DIV_ROUND_UP(ncp, sizeof(u32))); stm32_hash_set_nblw(hdev, ncp);
reg = stm32_hash_read(hdev, HASH_STR); reg = stm32_hash_read(hdev, HASH_STR);
reg |= HASH_STR_DCAL; reg |= HASH_STR_DCAL;
stm32_hash_write(hdev, HASH_STR, reg); stm32_hash_write(hdev, HASH_STR, reg);