crypto: sahara - do not resize req->src when doing hash operations
authorOvidiu Panait <ovidiu.panait@windriver.com>
Sun, 24 Dec 2023 08:21:36 +0000 (10:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:18 +0000 (15:35 -0800)
commitc660aa7784b738b5788fe3d5913f15037293f6a7
tree13476b9bc47fbcee43ff6780c7c71b3543c78447
parent08489b1994cbbf0b41cff46fa3bcbf4cd96522ab
crypto: sahara - do not resize req->src when doing hash operations

[ Upstream commit a3c6f4f4d249cecaf2f34471aadbfb4f4ef57298 ]

When testing sahara sha256 speed performance with tcrypt (mode=404) on
imx53-qsrb board, multiple "Invalid numbers of src SG." errors are
reported. This was traced to sahara_walk_and_recalc() resizing req->src
and causing the subsequent dma_map_sg() call to fail.

Now that the previous commit fixed sahara_sha_hw_links_create() to take
into account the actual request size, rather than relying on sg->length
values, the resize operation is no longer necessary.

Therefore, remove sahara_walk_and_recalc() and simplify associated logic.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/sahara.c