alistair23-linux/drivers/spi
Martin Sperl 704f32d48a spi: bcm2835: enabling polling mode for transfers shorter than 30us
In cases of short transfer times the CPU is spending lots of time
in the interrupt handler and scheduler to reschedule the worker thread.

Measurements show that we have times where it takes 29.32us to between
the last clock change and the time that the worker-thread is running again
returning from wait_for_completion_timeout().

During this time the interrupt-handler is running calling complete()
and then also the scheduler is rescheduling the worker thread.

This time can vary depending on how much of the code is still in
CPU-caches, when there is a burst of spi transfers the subsequent delays
are in the order of 25us, so the value of 30us seems reasonable.

With polling the whole transfer of 4 bytes at 10MHz finishes after 6.16us
(CS down to up) with the real transfer (clock running) taking 3.56us.
So the efficiency has much improved and is also freeing CPU cycles,
reducing interrupts and context switches.

Because of the above 30us seems to be a reasonable limit for polling.

Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-10 19:50:52 +01:00
..
Kconfig Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-02-19 10:36:45 -08:00
Makefile Merge remote-tracking branches 'spi/topic/sirf', 'spi/topic/spidev', 'spi/topic/st-ssc' and 'spi/topic/ti-qspi' into spi-next 2015-02-08 11:16:58 +08:00
spi-adi-v3.c
spi-altera.c
spi-ath79.c
spi-atmel.c spi: atmel: Fix interrupt setup for PDC transfers 2015-02-26 11:34:23 +09:00
spi-au1550.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-bcm53xx.c treewide: Remove unnecessary BCMA_CORETABLE_END macro 2015-02-11 14:38:28 -08:00
spi-bcm53xx.h
spi-bcm63xx-hsspi.c
spi-bcm63xx.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-bcm2835.c spi: bcm2835: enabling polling mode for transfers shorter than 30us 2015-04-10 19:50:52 +01:00
spi-bfin-sport.c
spi-bfin5xx.c
spi-bitbang-txrx.h
spi-bitbang.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-butterfly.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-cadence.c Merge remote-tracking branches 'spi/topic/atmel', 'spi/topic/cadence', 'spi/topic/dw' and 'spi/topic/fsl-cpm' into spi-next 2014-12-08 12:17:12 +00:00
spi-clps711x.c
spi-coldfire-qspi.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-davinci.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-dln2.c spi/dln2: simplify return flow for dln2_spi_transfer_setup and dln2_spi_enable 2015-01-06 17:02:50 +00:00
spi-dw-mid.c spi: dw-mid: avoid potential NULL dereference 2015-03-06 11:23:26 +00:00
spi-dw-mmio.c
spi-dw-pci.c spi: dw-pci: correct number of chip selects 2015-02-24 16:59:32 +09:00
spi-dw.c spi: dw: revisit FIFO size detection again 2015-02-26 11:09:51 +09:00
spi-dw.h
spi-efm32.c
spi-ep93xx.c
spi-falcon.c Merge remote-tracking branches 'spi/topic/falcon', 'spi/topic/fsf', 'spi/topic/fsl', 'spi/topic/fsl-dspi' and 'spi/topic/gpio' into spi-next 2015-02-08 11:16:46 +08:00
spi-fsl-cpm.c spi: fsl-(e)spi: Support compile as module 2015-01-06 17:03:34 +00:00
spi-fsl-cpm.h
spi-fsl-dspi.c spi: fsl-dspi: Remove possible memory leak of 'chip' 2015-02-02 20:05:19 +00:00
spi-fsl-espi.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
spi-fsl-lib.c spi: fsl-(e)spi: Support compile as module 2015-01-06 17:03:34 +00:00
spi-fsl-lib.h spi: fsl-(e)spi: Support compile as module 2015-01-06 17:03:34 +00:00
spi-fsl-spi.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
spi-fsl-spi.h
spi-gpio.c Merge remote-tracking branches 'spi/topic/falcon', 'spi/topic/fsf', 'spi/topic/fsl', 'spi/topic/fsl-dspi' and 'spi/topic/gpio' into spi-next 2015-02-08 11:16:46 +08:00
spi-img-spfi.c spi: img-spfi: Verify max spfi transfer length 2015-03-03 14:26:34 +00:00
spi-imx.c Merge remote-tracking branches 'spi/topic/img-spfi', 'spi/topic/imx', 'spi/topic/inline', 'spi/topic/meson' and 'spi/topic/mxs' into spi-next 2015-02-08 11:16:52 +08:00
spi-lm70llp.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-meson-spifc.c spi: meson: Constify struct regmap_config 2015-01-05 20:11:32 +00:00
spi-mpc52xx-psc.c
spi-mpc52xx.c
spi-mpc512x-psc.c
spi-mxs.c spi: mxs: cleanup wait_for_completion return handling 2015-02-05 18:04:57 +00:00
spi-nuc900.c
spi-oc-tiny.c
spi-octeon.c
spi-omap-100k.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-omap-uwire.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-omap2-mcspi.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-orion.c spi: orion: Add multiple chip select support to spi-orion 2015-01-16 12:38:54 +00:00
spi-pl022.c spi: pl022: Fix race in giveback() leading to driver lock-up 2015-03-06 19:45:55 +00:00
spi-ppc4xx.c
spi-pxa2xx-dma.c spi: pxa2xx: Cleanup register access macros 2014-12-22 20:17:23 +00:00
spi-pxa2xx-pci.c spi: spi-pxa2xx: SPI support for Intel Quark X1000 2014-11-26 18:07:45 +00:00
spi-pxa2xx-pxadma.c Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pxa2xx', 'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/samsung' into spi-next 2015-02-08 11:16:55 +08:00
spi-pxa2xx.c Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pxa2xx', 'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/samsung' into spi-next 2015-02-08 11:16:55 +08:00
spi-pxa2xx.h spi: pxa2xx: Cleanup register access macros 2014-12-22 20:17:23 +00:00
spi-qup.c spi: qup: Add SPI_CPOL configuration support 2014-12-29 17:14:21 +00:00
spi-rockchip.c spi/rockchip: avoid uninitialized-use warning 2015-01-28 17:36:37 +00:00
spi-rspi.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c
spi-s3c64xx.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-sc18is602.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-sh-hspi.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-sh-msiof.c spi: sh-msiof: cleanup wait_for_completion return handling 2015-02-04 20:52:53 +00:00
spi-sh-sci.c
spi-sh.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-sirf.c spi: sirf: drop redundant sirf,marco-spi compatible string 2015-01-06 17:38:59 +00:00
spi-st-ssc4.c spi: st-ssc4: Remove duplicate code to test unsupported mode bits 2015-01-14 19:16:56 +00:00
spi-sun4i.c
spi-sun6i.c
spi-tegra20-sflash.c
spi-tegra20-slink.c
spi-tegra114.c
spi-ti-qspi.c drivers: spi: ti-qspi: wait for busy bit clear before data write/read 2015-02-21 18:29:09 +09:00
spi-tle62x0.c
spi-topcliff-pch.c spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
spi-txx9.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
spi-xcomm.c
spi-xilinx.c spi/xilinx: Fix access invalid memory on xilinx_spi_tx 2015-02-02 12:17:19 +00:00
spi-xtensa-xtfpga.c
spi.c Merge remote-tracking branches 'spi/topic/img-spfi', 'spi/topic/imx', 'spi/topic/inline', 'spi/topic/meson' and 'spi/topic/mxs' into spi-next 2015-02-08 11:16:52 +08:00
spidev.c Merge remote-tracking branches 'spi/topic/sirf', 'spi/topic/spidev', 'spi/topic/st-ssc' and 'spi/topic/ti-qspi' into spi-next 2015-02-08 11:16:58 +08:00