aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-lib.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-09-07 22:50:22 +0200
committerMark Brown <broonie@kernel.org>2016-09-12 19:58:45 +0100
commit1423877b73ed5f4982eaba8bed359605b9918a2b (patch)
tree19fe399436429fe4b6086f33300e619d1abb648e /drivers/spi/spi-fsl-lib.h
parentspi: fsl-espi: remove unneeded check in fsl_espi_do_trans (diff)
downloadlinux-dev-1423877b73ed5f4982eaba8bed359605b9918a2b.tar.xz
linux-dev-1423877b73ed5f4982eaba8bed359605b9918a2b.zip
spi: fsl-espi: pre-allocate message buffer
Currently the driver allocates a 64kb buffer for each single message. On systems with little and fragmented memory this can result in memory allocation errors. Solve this by pre-allocating a buffer. This patch was developed in OpenWRT long ago, however it never made it upstream. I slightly modified the original patch to re-initialize the buffer at the beginning of each transfer. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-lib.h')
-rw-r--r--drivers/spi/spi-fsl-lib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h
index 84f5dcb7a897..065b9db212cf 100644
--- a/drivers/spi/spi-fsl-lib.h
+++ b/drivers/spi/spi-fsl-lib.h
@@ -30,6 +30,7 @@ struct mpc8xxx_spi {
void *rx;
#if IS_ENABLED(CONFIG_SPI_FSL_ESPI)
int len;
+ u8 *local_buf;
#endif
int subblock;