linux/drivers/spi
Maxime Chevallier 9b46e5e9a3 spi: Fix scatterlist elements size in spi_map_buf
commit ce99319a18 upstream.

When SPI transfers can be offloaded using DMA, the SPI core need to
build a scatterlist to make sure that the buffer to be transferred is
dma-able.

This patch fixes the scatterlist entry size computation in the case
where the maximum acceptable scatterlist entry supported by the DMA
controller is less than PAGE_SIZE, when the buffer is vmalloced.

For each entry, the actual size is given by the minimum between the
desc_len (which is the max buffer size supported by the DMA controller)
and the remaining buffer length until we cross a page boundary.

Fixes: 65598c13fd ("spi: Fix per-page mapping of unaligned vmalloc-ed buffer")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:21:35 +02:00
..
Kconfig Revert "spi: SPI_FSL_DSPI should depend on HAS_DMA" 2017-12-16 10:33:50 +01:00
Makefile
spi-adi-v3.c
spi-altera.c
spi-ath79.c
spi-atmel.c spi: atmel: fixed spin_lock usage inside atmel_spi_remove 2018-03-03 10:19:42 +01:00
spi-au1550.c
spi-bcm53xx.c
spi-bcm53xx.h
spi-bcm63xx-hsspi.c
spi-bcm63xx.c
spi-bcm2835.c
spi-bcm2835aux.c
spi-bfin-sport.c
spi-bfin5xx.c
spi-bitbang-txrx.h
spi-bitbang.c
spi-butterfly.c
spi-cadence.c
spi-clps711x.c
spi-coldfire-qspi.c
spi-davinci.c spi: davinci: fix up dma_mapping_error() incorrect patch 2018-04-08 11:52:02 +02:00
spi-dln2.c
spi-dw-mid.c
spi-dw-mmio.c spi: dw: Disable clock after unregistering the host 2018-03-24 10:58:41 +01:00
spi-dw-pci.c
spi-dw.c spi: dw: Make debugfs name unique between instances 2017-08-06 19:19:44 -07:00
spi-dw.h
spi-efm32.c
spi-ep93xx.c
spi-falcon.c
spi-fsl-cpm.c
spi-fsl-cpm.h
spi-fsl-dspi.c
spi-fsl-espi.c
spi-fsl-lib.c
spi-fsl-lib.h
spi-fsl-spi.c
spi-fsl-spi.h
spi-gpio.c
spi-img-spfi.c
spi-imx.c spi: imx: do not access registers while clocks disabled 2018-02-03 17:04:31 +01:00
spi-lm70llp.c
spi-meson-spifc.c
spi-mpc52xx-psc.c
spi-mpc52xx.c
spi-mpc512x-psc.c
spi-mt65xx.c
spi-mxs.c
spi-nuc900.c
spi-oc-tiny.c
spi-octeon.c
spi-omap-100k.c
spi-omap-uwire.c
spi-omap2-mcspi.c spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer 2018-03-22 09:23:22 +01:00
spi-orion.c
spi-pl022.c
spi-ppc4xx.c
spi-pxa2xx-dma.c
spi-pxa2xx-pci.c
spi-pxa2xx.c
spi-pxa2xx.h spi: pxa2xx: Allow 64-bit DMA 2018-05-26 08:48:52 +02:00
spi-qup.c
spi-rb4xx.c
spi-rockchip.c
spi-rspi.c
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c
spi-s3c64xx.c
spi-sc18is602.c
spi-sh-hspi.c
spi-sh-msiof.c spi: sh-msiof: Fix DMA transfer size check 2017-12-09 18:42:39 +01:00
spi-sh-sci.c
spi-sh.c
spi-sirf.c
spi-st-ssc4.c
spi-sun4i.c spi: sun4i: disable clocks in the remove function 2018-02-25 11:03:41 +01:00
spi-sun6i.c spi: sun6i: disable/unprepare clocks on remove 2018-03-22 09:23:28 +01:00
spi-tegra20-sflash.c
spi-tegra20-slink.c
spi-tegra114.c
spi-ti-qspi.c
spi-tle62x0.c
spi-topcliff-pch.c
spi-txx9.c
spi-xcomm.c
spi-xilinx.c spi: xilinx: Detect stall with Unknown commands 2018-01-02 20:33:21 +01:00
spi-xlp.c
spi-xtensa-xtfpga.c
spi-zynqmp-gqspi.c
spi.c spi: Fix scatterlist elements size in spi_map_buf 2018-07-03 11:21:35 +02:00
spidev.c