]> git.itanic.dy.fi Git - linux-stable/commit
crypto: crypto4xx - reduce memory fragmentation
authorChristian Lamparter <chunkeey@gmail.com>
Wed, 1 Jan 2020 22:27:01 +0000 (23:27 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Jan 2020 03:30:53 +0000 (11:30 +0800)
commitb87b2c4d9105a4cfa70c9271b847364ac045125c
tree096f6948f76b97f66f363c675d0cef75edf7a0d9
parentaf5034e8e4a5838fc77e476c1a91822e449d5869
crypto: crypto4xx - reduce memory fragmentation

With recent kernels (>5.2), the driver fails to probe, as the
allocation of the driver's scatter buffer fails with -ENOMEM.

This happens in crypto4xx_build_sdr(). Where the driver tries
to get 512KiB (=PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD) of
continuous memory. This big chunk is by design, since the driver
uses this circumstance in the crypto4xx_copy_pkt_to_dst() to
its advantage:
"all scatter-buffers are all neatly organized in one big
continuous ringbuffer; So scatterwalk_map_and_copy() can be
instructed to copy a range of buffers in one go."

The PowerPC arch does not have support for DMA_CMA. Hence,
this patch reorganizes the order in which the memory
allocations are done. Since the driver itself is responsible
for some of the issues.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/amcc/crypto4xx_core.c