linux/drivers/spi
Mark Brown 0461a41498 spi: Pump transfers inside calling context for spi_sync()
If we are using the standard SPI message pump (which all drivers should be
transitioning over to) then special case the message enqueue and instead of
starting the worker thread to push messages to the hardware do so in the
context of the caller if the controller is idle. This avoids a context
switch in the common case where the controller has a single user in a
single thread, for short PIO transfers there may be no need to context
switch away from the calling context to complete the transfer.

The code is a bit more complex than is desirable in part due to the need
to handle drivers not using the standard queue and in part due to handling
the various combinations of bus locking and asynchronous submission in
interrupt context.

It is still suboptimal since it will still wake the message pump for each
transfer in order to schedule idling of the hardware and if multiple
contexts are using the controller simultaneously a caller may end up
pumping a message for some random other thread rather than for itself,
and if the thread ends up deferring due to another context idling the
hardware then it will just busy wait.  It can, however, have the benefit
of aggregating power up and down of the hardware when a caller performs
a series of transfers back to back without any need for the use of
spi_async().

Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-11 12:23:51 +00:00
..
Kconfig Merge remote-tracking branches 'spi/topic/mxs', 'spi/topic/pxa', 'spi/topic/rockchip', 'spi/topic/samsung' and 'spi/topic/sirf' into spi-next 2014-12-08 12:17:17 +00:00
Makefile Merge remote-tracking branches 'spi/topic/fsl-dspi', 'spi/topic/fsl-espi', 'spi/topic/gpio', 'spi/topic/img-spfi' and 'spi/topic/meson' into spi-next 2014-12-08 12:17:15 +00:00
spi-adi-v3.c spi: spi-adi-v3: Remove redundant OOM message 2014-06-21 11:14:02 +01:00
spi-altera.c Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/init', 'spi/topic/mpc512x-psc', 'spi/topic/mpc52xx', 'spi/topic/mxs', 'spi/topic/nuc900', 'spi/topic/oc-tiny' and 'spi/topic/octeon' into spi-next 2014-03-30 00:51:17 +00:00
spi-ath79.c spi: Remove unneeded include of linux/workqueue.h 2014-04-14 17:20:15 +01:00
spi-atmel.c spi: atmel: introduce probe deferring 2014-11-24 18:57:37 +00:00
spi-au1550.c spi: spi-au1550: fix build failure 2014-08-19 16:17:57 -05:00
spi-bcm53xx.c spi: bcm53xx: Add missing module information 2014-09-26 09:08:10 +01:00
spi-bcm53xx.h spi: bcm53xx: driver for SPI controller on Broadcom bcma SoC 2014-08-19 11:30:55 -05:00
spi-bcm63xx-hsspi.c spi: Remove unneeded include of linux/workqueue.h 2014-04-14 17:20:15 +01:00
spi-bcm63xx.c spi: Remove unneeded include of linux/workqueue.h 2014-04-14 17:20:15 +01:00
spi-bcm2835.c spi: Remove explictly set bus_num and num_chipselect to default setting 2014-02-16 09:51:02 +08:00
spi-bfin5xx.c spi: bfin5xx: fix build error 2014-04-14 20:44:15 +01:00
spi-bfin-sport.c spi: delete non-required instances of include <linux/init.h> 2014-02-03 12:20:35 +00:00
spi-bitbang-txrx.h spi: bitbang: Grammar s/make to make/to make/ 2014-01-13 11:24:21 +00:00
spi-bitbang.c Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/init', 'spi/topic/mpc512x-psc', 'spi/topic/mpc52xx', 'spi/topic/mxs', 'spi/topic/nuc900', 'spi/topic/oc-tiny' and 'spi/topic/octeon' into spi-next 2014-03-30 00:51:17 +00:00
spi-butterfly.c spi: bitbang: Make spi_bitbang_stop() return void 2014-03-29 11:09:26 +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: clps711x: Migrate to the new clk subsystem 2014-09-24 09:40:24 +01:00
spi-coldfire-qspi.c Merge remote-tracking branches 'spi/topic/bus-num', 'spi/topic/cleanup', 'spi/topic/clps711x', 'spi/topic/coldfire', 'spi/topic/completion' and 'spi/topic/davinci' into spi-next 2014-03-30 00:51:03 +00:00
spi-davinci.c Merge remote-tracking branches 'spi/topic/davinci', 'spi/topic/doc', 'spi/topic/dw' and 'spi/topic/fsl' into spi-next 2014-10-03 16:33:39 +01:00
spi-dw-mid.c spi: dw-mid: split rx and tx callbacks when DMA 2014-10-28 22:40:38 +00:00
spi-dw-mmio.c spi: dw-mmio: add devicetree support 2014-07-03 19:44:04 +01:00
spi-dw-pci.c Merge remote-tracking branches 'spi/topic/davinci', 'spi/topic/doc', 'spi/topic/dw' and 'spi/topic/fsl' into spi-next 2014-10-03 16:33:39 +01:00
spi-dw.c Merge remote-tracking branches 'spi/fix/dw' and 'spi/fix/sirf' into spi-linus 2014-11-26 19:05:25 +00:00
spi-dw.h spi: dw-mid: split rx and tx callbacks when DMA 2014-10-28 22:40:38 +00:00
spi-efm32.c spi: efm32: correct namespacing of location property 2014-07-11 13:39:36 +01:00
spi-ep93xx.c spi: ep93xx: Fix checkpatch issue 2014-09-02 11:47:12 +01:00
spi-falcon.c spi: falcon: Remove unnecessary platform_set_drvdata() 2014-06-06 11:14:29 +01:00
spi-fsl-cpm.c spi: fsl-spi: Don't use cpm_command on CPM1 2014-11-21 18:12:42 +00:00
spi-fsl-cpm.h
spi-fsl-dspi.c Merge remote-tracking branches 'spi/topic/fsl-dspi', 'spi/topic/fsl-espi', 'spi/topic/gpio', 'spi/topic/img-spfi' and 'spi/topic/meson' into spi-next 2014-12-08 12:17:15 +00:00
spi-fsl-espi.c spi: fsl-espi: add (un)prepare_transfer_hardware calls to save power if SPI is not in use 2014-12-03 13:05:47 +00:00
spi-fsl-lib.c spi: fsl-(e)spi: migrate to generic master queueing 2014-12-03 13:05:47 +00:00
spi-fsl-lib.h spi: fsl-(e)spi: migrate to generic master queueing 2014-12-03 13:05:47 +00:00
spi-fsl-spi.c spi: fsl-spi: remove unused variable assignment 2014-12-04 22:44:05 +00:00
spi-fsl-spi.h
spi-gpio.c spi: spi-gpio: Fix compiler warning when building for 64 bit systems 2014-11-08 09:12:57 +00:00
spi-img-spfi.c spi: Add driver for IMG SPFI controller 2014-11-17 13:31:08 +00:00
spi-imx.c spi: spi-imx: add DMA support 2014-09-17 11:36:11 -07:00
spi-lm70llp.c spi: bitbang: Let spi_bitbang_start() take a reference to master 2013-10-07 14:50:43 +01:00
spi-meson-spifc.c spi: meson: meson_spifc_setup_speed() can be static 2014-11-25 12:08:24 +00:00
spi-mpc52xx-psc.c Merge remote-tracking branches 'spi/fix/complete', 'spi/fix/efm32', 'spi/fix/omap2-mcspi' and 'spi/fix/qup' into spi-linus 2014-04-10 23:39:52 +01:00
spi-mpc52xx.c Merge remote-tracking branches 'spi/fix/complete', 'spi/fix/efm32', 'spi/fix/omap2-mcspi' and 'spi/fix/qup' into spi-linus 2014-04-10 23:39:52 +01:00
spi-mpc512x-psc.c Merge remote-tracking branches 'spi/fix/complete', 'spi/fix/efm32', 'spi/fix/omap2-mcspi' and 'spi/fix/qup' into spi-linus 2014-04-10 23:39:52 +01:00
spi-mxs.c spi: spi-mxs: Fix mapping from vmalloc-ed buffer to scatter list 2014-11-24 18:58:08 +00:00
spi-nuc900.c spi: Remove unneeded include of linux/workqueue.h 2014-04-14 17:20:15 +01:00
spi-oc-tiny.c Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/init', 'spi/topic/mpc512x-psc', 'spi/topic/mpc52xx', 'spi/topic/mxs', 'spi/topic/nuc900', 'spi/topic/oc-tiny' and 'spi/topic/octeon' into spi-next 2014-03-30 00:51:17 +00:00
spi-octeon.c Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/init', 'spi/topic/mpc512x-psc', 'spi/topic/mpc52xx', 'spi/topic/mxs', 'spi/topic/nuc900', 'spi/topic/oc-tiny' and 'spi/topic/octeon' into spi-next 2014-03-30 00:51:17 +00:00
spi-omap2-mcspi.c spi/omap-mcspi: Fix the spi task hangs waiting dma_rx 2014-08-11 19:55:51 +01:00
spi-omap-100k.c spi: omap-100k: Remove unused definitions 2014-08-16 17:12:14 -05:00
spi-omap-uwire.c spi: omap-uwire: Fix build error 2014-06-24 16:25:48 +01:00
spi-orion.c spi: orion: fix potential NULL pointer de-reference 2014-10-22 11:05:54 +01:00
spi-pl022.c spi: pl022: Fix incorrect dma_unmap_sg 2014-10-13 13:08:35 +02:00
spi-ppc4xx.c spi: delete non-required instances of include <linux/init.h> 2014-02-03 12:20:35 +00:00
spi-pxa2xx-dma.c spi/pxa2xx: Don't use slave_id of dma_slave_config 2014-09-18 11:54:07 +05:30
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 spi: delete non-required instances of include <linux/init.h> 2014-02-03 12:20:35 +00:00
spi-pxa2xx.c spi: spi-pxa2xx: SPI support for Intel Quark X1000 2014-11-26 18:07:45 +00:00
spi-pxa2xx.h spi: spi-pxa2xx: SPI support for Intel Quark X1000 2014-11-26 18:07:45 +00:00
spi-qup.c Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pl022', 'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/rspi' into spi-next 2014-08-04 17:21:12 +01:00
spi-rockchip.c Merge remote-tracking branches 'spi/topic/mxs', 'spi/topic/pxa', 'spi/topic/rockchip', 'spi/topic/samsung' and 'spi/topic/sirf' into spi-next 2014-12-08 12:17:17 +00:00
spi-rspi.c spi: rspi: Add support for new R-Car Gen2 SoCs 2014-08-28 15:33:17 +01:00
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c Merge remote-tracking branch 'spi/topic/workqueue' into spi-next 2014-06-02 17:08:43 +01:00
spi-s3c64xx.c spi/s3c64xx: Remove redundant runtime PM management 2014-12-07 13:47:21 +00:00
spi-sc18is602.c spi: sc18is602: Convert to let spi core validate transfer speed 2014-03-13 09:47:05 +00:00
spi-sh-hspi.c spi: sh-hspi: Make of_device_id array const 2014-06-06 12:37:41 +01:00
spi-sh-msiof.c spi: sh-msiof: Fix transmit-only DMA transfers 2014-08-31 13:41:46 +01:00
spi-sh-sci.c spi: sh-sci: fix use-after-free in sh_sci_spi_remove() 2014-06-17 15:47:31 +01:00
spi-sh.c spi/spi-sh: Use devm_ioremap 2014-07-07 12:50:52 +02:00
spi-sirf.c Merge remote-tracking branches 'spi/topic/mxs', 'spi/topic/pxa', 'spi/topic/rockchip', 'spi/topic/samsung' and 'spi/topic/sirf' into spi-next 2014-12-08 12:17:17 +00:00
spi-sun4i.c spi: Remove unneeded include of linux/workqueue.h 2014-04-14 17:20:15 +01:00
spi-sun6i.c spi: Remove unneeded include of linux/workqueue.h 2014-04-14 17:20:15 +01:00
spi-tegra20-sflash.c spi: tegra20-sflash: Fix checkpatch issue 2014-09-03 19:30:27 +01:00
spi-tegra20-slink.c spi: tegra20-slink: Make of_device_id array const 2014-05-07 20:53:05 +01:00
spi-tegra114.c spi: tegra114: Fix checkpatch issue 2014-09-03 19:30:26 +01:00
spi-ti-qspi.c Merge remote-tracking branches 'spi/topic/sunxi', 'spi/topic/tegra114', 'spi/topic/ti-qspi', 'spi/topic/ti-ssp', 'spi/topic/topcliff-pch', 'spi/topic/txx9', 'spi/topic/xcomm' and 'spi/topic/xfer' into spi-next 2014-03-30 00:51:41 +00:00
spi-tle62x0.c spi: tle62x0: remove unnecessary OOM messages 2014-04-29 12:01:42 -07:00
spi-topcliff-pch.c spi: topcliff-pch: don't hardcode PCI slot to get DMA device 2014-07-31 00:03:42 +01:00
spi-txx9.c spi/txx9: Deletion of an unnecessary check before the function call "clk_disable" 2014-12-01 19:25:14 +00:00
spi-xcomm.c Merge remote-tracking branches 'spi/topic/sunxi', 'spi/topic/tegra114', 'spi/topic/ti-qspi', 'spi/topic/ti-ssp', 'spi/topic/topcliff-pch', 'spi/topic/txx9', 'spi/topic/xcomm' and 'spi/topic/xfer' into spi-next 2014-03-30 00:51:41 +00:00
spi-xilinx.c spi: xilinx: Remove .owner field for driver 2014-08-16 17:15:47 -05:00
spi-xtensa-xtfpga.c spi: xtensa-xtfpga: Fix checkpatch issue 2014-09-02 11:47:12 +01:00
spi.c spi: Pump transfers inside calling context for spi_sync() 2014-12-11 12:23:51 +00:00
spidev.c spi: spidev: Don't mangle max_speed_hz in underlying spi device 2014-11-11 18:01:28 +00:00