linux-stable/drivers/spi
Miquel Raynal e0205d6203
spi: atmel: Prevent false timeouts on long transfers
A slow SPI bus clocks at ~20MHz, which means it would transfer about
2500 bytes per second with a single data line. Big transfers, like when
dealing with flashes can easily reach a few MiB. The current DMA timeout
is set to 1 second, which means any working transfer of about 4MiB will
always be cancelled.

With the above derivations, on a slow bus, we can assume every byte will
take at most 0.4ms. Said otherwise, we could add 4ms to the 1-second
timeout delay every 10kiB. On a 4MiB transfer, it would bring the
timeout delay up to 2.6s which still seems rather acceptable for a
timeout.

The consequence of this is that long transfers might be allowed, which
hence requires the need to interrupt the transfer if wanted by the
user. We can hence switch to the _interruptible variant of
wait_for_completion. This leads to a little bit more handling to also
handle the interrupted case but looks really acceptable overall.

While at it, we drop the useless, noisy and redundant WARN_ON() call.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Ryan Wanner <ryan.wanner@microchip.com>
Link: https://lore.kernel.org/r/Message-Id: <20230622090634.3411468-3-miquel.raynal@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 22:22:49 +01:00
..
atmel-quadspi.c spi: atmel-quadspi: Convert to platform remove callback returning void 2023-03-17 15:47:51 +00:00
internals.h
Kconfig spi: stm32: introduction of stm32h7 SPI device mode support 2023-06-15 12:09:32 +01:00
Makefile spi: add support for Amlogic A1 SPI Flash Controller 2023-04-11 12:40:30 +01:00
spi-altera-core.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-altera-dfl.c spi: spi-altera-dfl: switch to use modern name 2022-12-29 13:22:04 +00:00
spi-altera-platform.c spi: spi-altera-platform: switch to use modern name 2022-12-29 13:22:05 +00:00
spi-amd.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-amlogic-spifc-a1.c spi: add support for Amlogic A1 SPI Flash Controller 2023-04-11 12:40:30 +01:00
spi-ar934x.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-armada-3700.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-aspeed-smc.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-at91-usart.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-ath79.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-atmel.c spi: atmel: Prevent false timeouts on long transfers 2023-06-22 22:22:49 +01:00
spi-au1550.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-axi-spi-engine.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-bcm-qspi.c spi: bcm-qspi: Mark OF related data as maybe unused 2023-03-13 14:09:12 +00:00
spi-bcm-qspi.h spi: bcm-qspi: Make bcm_qspi_remove() return void 2022-10-18 19:16:53 +01:00
spi-bcm63xx-hsspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-bcm63xx.c spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS 2023-04-25 16:55:45 +01:00
spi-bcm2835.c spi: bcm2835: Convert to platform remove callback returning void 2023-03-31 12:54:07 +01:00
spi-bcm2835aux.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-bcmbca-hsspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-bitbang-txrx.h spi: bitbang: Fix lsb-first Rx 2022-08-15 01:26:20 +01:00
spi-bitbang.c
spi-brcmstb-qspi.c spi: brcmstb-qspi: Convert to platform remove callback returning void 2023-03-06 12:31:15 +00:00
spi-butterfly.c
spi-cadence-quadspi.c spi: cadence-quadspi: Add compatible for AMD Pensando Elba SoC 2023-05-17 10:38:57 +09:00
spi-cadence-xspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-cadence.c spi: Merge up fixes to help CI 2023-05-30 18:38:18 +01:00
spi-cavium-octeon.c spi: cavium-octeon: Convert to platform remove callback returning void 2023-03-06 12:31:17 +00:00
spi-cavium-thunderx.c
spi-cavium.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-cavium.h
spi-clps711x.c
spi-coldfire-qspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-davinci.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-dln2.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-dw-bt1.c spi: dw-bt1: Convert to platform remove callback returning void 2023-03-06 12:31:21 +00:00
spi-dw-core.c spi: dw: Drop empty line from DebugFS init function 2023-05-31 12:25:17 +01:00
spi-dw-dma.c spi: dw: Add DMA address widths capability check 2023-05-15 10:46:17 +09:00
spi-dw-mmio.c spi: dw: Remove misleading comment for Mount Evans SoC 2023-06-07 12:37:50 +01:00
spi-dw-pci.c
spi-dw.h spi: dw: Add DMA address widths capability check 2023-05-15 10:46:17 +09:00
spi-ep93xx.c spi: ep93xx: Convert to platform remove callback returning void 2023-03-06 12:31:23 +00:00
spi-falcon.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-fsi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-fsl-cpm.c spi: fsl-cpm: Use 16 bit mode for large transfers with even size 2023-04-05 12:33:34 +01:00
spi-fsl-cpm.h
spi-fsl-dspi.c spi: fsl-dspi: Remove unneeded cast to same type 2023-03-13 14:09:03 +00:00
spi-fsl-espi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-fsl-lib.c
spi-fsl-lib.h
spi-fsl-lpspi.c spi: spi-fsl-lpspi: downgrade log level for pio mode 2023-05-31 12:25:16 +01:00
spi-fsl-qspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-fsl-spi.c spi: fsl-spi: No need to check transfer length versus word size 2023-04-05 12:33:36 +01:00
spi-fsl-spi.h
spi-geni-qcom.c spi: Merge up fixes to help CI 2023-05-30 18:38:18 +01:00
spi-gpio.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-gxp.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-hisi-kunpeng.c spi: hisi-kunpeng: Fix error checking 2023-05-18 19:26:36 +09:00
spi-hisi-sfc-v3xx.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-img-spfi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-imx.c spi: spi-imx: fix mixing of native and gpio chipselects for imx51/imx53/imx6 variants 2023-06-02 13:15:14 +01:00
spi-ingenic.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-intel-pci.c spi: intel-pci: Add support for Meteor Lake-S SPI serial flash 2023-03-31 12:54:07 +01:00
spi-intel-platform.c
spi-intel.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-intel.h
spi-iproc-qspi.c spi: iproc-qspi: Convert to platform remove callback returning void 2023-03-06 12:31:31 +00:00
spi-jcore.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-lantiq-ssc.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-lm70llp.c
spi-loopback-test.c spi: spi-loopback-test: Add module param for iteration length 2023-04-13 11:42:20 +01:00
spi-lp8841-rtc.c
spi-mem.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-meson-spicc.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-meson-spifc.c spi: meson-spifc: Convert to platform remove callback returning void 2023-03-06 12:31:33 +00:00
spi-microchip-core-qspi.c spi: microchip-core-qspi: Convert to platform remove callback returning void 2023-03-06 12:31:34 +00:00
spi-microchip-core.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-mpc52xx-psc.c spi: mpc5xxx-psc: Consistently use device property APIs 2023-03-07 13:58:34 +00:00
spi-mpc52xx.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-mpc512x-psc.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-mt65xx.c spi: Merge up fixes to help CI 2023-05-30 18:38:18 +01:00
spi-mt7621.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-mtk-nor.c spi: mtk-nor: Convert to platform remove callback returning void 2023-03-06 21:17:45 +00:00
spi-mtk-snfi.c spi: mtk-snfi: Convert to platform remove callback returning void 2023-03-06 21:17:46 +00:00
spi-mux.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-mxic.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-mxs.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-npcm-fiu.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-npcm-pspi.c spi: npcm-pspi: Convert to platform remove callback returning void 2023-03-06 21:17:50 +00:00
spi-nxp-fspi.c spi: spi-nxp-fspi: use DLL calibration when clock rate > 100MHz 2023-03-22 13:17:43 +00:00
spi-oc-tiny.c spi: oc-tiny: Convert to platform remove callback returning void 2023-03-06 21:17:51 +00:00
spi-omap-uwire.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-omap2-mcspi.c spi: omap2-mcspi: Use devm_platform_get_and_ioremap_resource() 2023-03-27 12:42:32 +01:00
spi-orion.c spi: orion: Use devm_platform_get_and_ioremap_resource() 2023-03-27 12:42:33 +01:00
spi-pci1xxxx.c spi: mchp-pci1xxxx: Fix improper implementation of disabling chip select lines 2023-04-05 12:33:28 +01:00
spi-pic32-sqi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-pic32.c spi: pic32: Use devm_platform_get_and_ioremap_resource() 2023-03-27 12:42:34 +01:00
spi-pl022.c spi: spl022: Probe defer is no error 2023-06-02 19:15:42 +01:00
spi-ppc4xx.c spi: ppc4xx: Convert to platform remove callback returning void 2023-03-06 21:17:57 +00:00
spi-pxa2xx-dma.c
spi-pxa2xx-pci.c
spi-pxa2xx.c spi: pxa2xx: Mark OF related data as maybe unused 2023-03-13 14:09:11 +00:00
spi-pxa2xx.h
spi-qcom-qspi.c spi: spi-qcom-qspi: Add newline to PIO fallback warning 2023-05-30 19:28:48 +01:00
spi-qup.c spi: qup: Request DMA before enabling clocks 2023-05-30 13:43:31 +01:00
spi-rb4xx.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-realtek-rtl.c
spi-rockchip-sfc.c spi: Updates for v6.4 2023-04-27 11:02:26 -07:00
spi-rockchip.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-rpc-if.c spi: rpc-if: Convert to platform remove callback returning void 2023-03-06 21:18:02 +00:00
spi-rspi.c spi: rspi: Mark OF related data as maybe unused 2023-03-13 14:09:15 +00:00
spi-s3c64xx.c spi: s3c64xx: Use dev_err_probe() 2023-06-06 13:53:39 +01:00
spi-sc18is602.c spi: Switch i2c drivers back to use .probe() 2023-05-26 16:35:29 +01:00
spi-sh-hspi.c spi: sh-hspi: Convert to platform remove callback returning void 2023-03-06 21:18:06 +00:00
spi-sh-msiof.c spi: struct spi_device constification 2023-03-13 18:19:31 +00:00
spi-sh-sci.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-sh.c spi: sh: Convert to platform remove callback returning void 2023-03-06 21:18:08 +00:00
spi-sifive.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-slave-mt27xx.c spi: slave-mt27xx: Convert to platform remove callback returning void 2023-03-06 21:18:10 +00:00
spi-slave-system-control.c
spi-slave-time.c
spi-sn-f-ospi.c spi: spi-sn-f-ospi: Make read-only array width_available static const 2023-05-30 13:47:03 +01:00
spi-sprd-adi.c spi: sprd-adi: Use devm_platform_get_and_ioremap_resource() 2023-03-27 12:42:35 +01:00
spi-sprd.c spi: sprd: Use devm_platform_get_and_ioremap_resource() 2023-03-27 12:42:35 +01:00
spi-st-ssc4.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-stm32-qspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-stm32.c spi: stm32: introduction of stm32h7 SPI device mode support 2023-06-15 12:09:32 +01:00
spi-sun4i.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-sun6i.c spi: sun6i: add support for R329/D1/R528/T113s SPI controllers 2023-05-12 13:07:44 +09:00
spi-sunplus-sp7021.c spi: sunplus-sp7021: Convert to platform remove callback returning void 2023-03-06 21:18:18 +00:00
spi-synquacer.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-tegra20-sflash.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-tegra20-slink.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-tegra114.c spi: tegra114: Use devm_platform_get_and_ioremap_resource() 2023-04-04 12:46:56 +01:00
spi-tegra210-quad.c spi: tegra210-quad: Enable TPM wait polling 2023-04-21 14:37:04 +01:00
spi-test.h
spi-ti-qspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-tle62x0.c
spi-topcliff-pch.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-uniphier.c spi: uniphier: Convert to platform remove callback returning void 2023-03-06 21:18:24 +00:00
spi-wpcm-fiu.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-xcomm.c spi: Switch i2c drivers back to use .probe() 2023-05-26 16:35:29 +01:00
spi-xilinx.c spi: xilinx: Use devm_platform_get_and_ioremap_resource() 2023-03-28 14:49:37 +01:00
spi-xlp.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-xtensa-xtfpga.c spi: xtensa-xtfpga: Convert to platform remove callback returning void 2023-03-06 21:18:26 +00:00
spi-zynq-qspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi-zynqmp-gqspi.c spi: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:01 +00:00
spi.c Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
spidev.c spi: spidev: add two new spi mode bits 2023-05-30 15:20:10 +01:00