linux-stable/drivers/spi
Christophe Leroy 60afe299bb spi: fsl-cpm: Use 16 bit mode for large transfers with even size
(cherry picked from upstream fc96ec826b)

On CPM, the RISC core is a lot more efficiant when doing transfers
in 16-bits chunks than in 8-bits chunks, but unfortunately the
words need to be byte swapped as seen in a previous commit.

So, for large tranfers with an even size, allocate a temporary tx
buffer and byte-swap data before and after transfer.

This change allows setting higher speed for transfer. For instance
on an MPC 8xx (CPM1 comms RISC processor), the documentation tells
that transfer in byte mode at 1 kbit/s uses 0.200% of CPM load
at 25 MHz while a word transfer at the same speed uses 0.032%
of CPM load. This means the speed can be 6 times higher in
word mode for the same CPM load.

For the time being, only do it on CPM1 as there must be a
trade-off between the CPM load reduction and the CPU load required
to byte swap the data.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/f2e981f20f92dd28983c3949702a09248c23845c.1680371809.git.christophe.leroy@csgroup.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-30 12:57:56 +01:00
..
atmel-quadspi.c spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller 2022-04-27 13:53:57 +02:00
internals.h
Kconfig spi: dw_bt1: fix MUX_MMIO dependencies 2023-03-11 16:39:35 +01:00
Makefile ARM: SoC platform updates 2020-10-24 10:33:08 -07:00
spi-altera.c spi: altera: Fix memory leak on error path 2021-02-03 23:28:46 +01:00
spi-amd.c spi: amd: Limit max transfer and message size 2022-07-21 21:20:03 +02:00
spi-ar934x.c spi: ar934x: Don't leak SPI master in probe error path 2020-12-30 11:54:20 +01:00
spi-armada-3700.c spi: change clk_disable_unprepare to clk_unprepare 2021-12-29 12:25:54 +01:00
spi-at91-usart.c spi: spi-at91-usart: Remove unused OF table 'struct of_device_id' 2020-07-17 16:38:54 +01:00
spi-ath79.c spi: ath79: remove spi-master setup and cleanup assignment 2021-05-11 14:47:16 +02:00
spi-atmel.c spi: atmel: Put allocated master before return 2021-03-04 11:37:59 +01:00
spi-au1550.c
spi-axi-spi-engine.c
spi-bcm-qspi.c spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() 2022-04-13 21:01:06 +02:00
spi-bcm-qspi.h
spi-bcm63xx-hsspi.c spi: bcm63xx-hsspi: Fix multi-bit mode setting 2023-03-11 16:39:37 +01:00
spi-bcm63xx.c spi: bcm63xx-spi: add reset support 2020-06-17 14:29:58 +01:00
spi-bcm2835.c spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers 2022-07-29 17:19:23 +02:00
spi-bcm2835aux.c spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe 2020-11-13 18:22:24 +00:00
spi-bitbang-txrx.h
spi-bitbang.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-brcmstb-qspi.c
spi-butterfly.c
spi-cadence-quadspi.c spi: cadence-quadspi: fix suspend-resume implementations 2023-05-17 11:47:57 +02:00
spi-cadence.c spi: cadence: Correct initialisation of runtime PM again 2021-07-28 14:35:39 +02:00
spi-cavium-octeon.c
spi-cavium-thunderx.c spi: spi-cavium-thunderx: flag controller as half duplex 2020-06-16 00:38:39 +01:00
spi-cavium.c
spi-cavium.h
spi-clps711x.c
spi-coldfire-qspi.c spi: coldfire-qspi: Use clk_disable_unprepare in the remove function 2021-09-15 09:50:29 +02:00
spi-davinci.c spi: davinci: invoke chipselect callback 2021-09-15 09:50:30 +02:00
spi-dln2.c spi: dln2: Fix reference leak to master 2021-05-11 14:47:20 +02:00
spi-dw-bt1.c spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe 2022-10-26 13:25:21 +02:00
spi-dw-core.c spi: dw: Fix wrong FIFO level setting for long xfers 2023-02-15 17:22:25 +01:00
spi-dw-dma.c spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld() 2022-12-02 17:39:59 +01:00
spi-dw-mmio.c spi: dw: Add DWC SSI capability 2020-10-08 23:00:06 +01:00
spi-dw-pci.c spi: dw: Add DWC SSI capability 2020-10-08 23:00:06 +01:00
spi-dw.h spi: dw: Introduce max mem-ops SPI bus frequency setting 2020-10-08 23:00:20 +01:00
spi-efm32.c
spi-ep93xx.c spi: spi-ep93xx: Fix API slippage 2020-07-17 16:38:47 +01:00
spi-falcon.c
spi-fsi.c spi: fsi: Fix transfer returning without finalizing message 2020-11-11 12:34:29 +00:00
spi-fsl-cpm.c spi: fsl-cpm: Use 16 bit mode for large transfers with even size 2023-05-30 12:57:56 +01:00
spi-fsl-cpm.h
spi-fsl-dspi.c spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config 2021-09-15 09:50:28 +02:00
spi-fsl-espi.c Merge remote-tracking branch 'spi/for-5.10' into spi-next 2020-10-09 16:01:22 +01:00
spi-fsl-lib.c
spi-fsl-lib.h
spi-fsl-lpspi.c spi: fsl-lpspi: Fix PM reference leak in lpspi_prepare_xfer_hardware() 2021-05-14 09:50:18 +02:00
spi-fsl-qspi.c spi: spi-fsl-qspi: check return value after calling platform_get_resource_byname() 2022-06-09 10:21:06 +02:00
spi-fsl-spi.c spi: fsl-cpm: Use 16 bit mode for large transfers with even size 2023-05-30 12:57:56 +01:00
spi-fsl-spi.h
spi-geni-qcom.c spi: spi-geni-qcom: Fix geni_spi_isr() NULL dereference in timeout case 2021-01-17 14:17:00 +01:00
spi-gpio.c spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode 2023-01-14 10:15:41 +01:00
spi-hisi-sfc-v3xx.c spi: hisi-sfc-v3xx: fix spelling mistake "occured" -> "occurred" 2020-09-28 20:33:56 +01:00
spi-img-spfi.c spi: img-spfi: Fix pm_runtime_get_sync() error checking 2022-06-09 10:21:02 +02:00
spi-imx.c spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3 2023-05-30 12:57:50 +01:00
spi-iproc-qspi.c
spi-jcore.c
spi-lantiq-ssc.c spi: lantiq: remove redundant irqsave and irqrestore in hardIRQ 2020-09-17 19:56:02 +01:00
spi-lm70llp.c
spi-loopback-test.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
spi-lp8841-rtc.c
spi-mem.c spi: spi-mem: fix reference leak in spi_mem_access_start 2020-12-30 11:53:02 +01:00
spi-meson-spicc.c spi: meson-spicc: do not rely on busy flag in pow2 clk ops 2022-10-26 13:25:20 +02:00
spi-meson-spifc.c spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe 2022-01-27 10:54:03 +01:00
spi-mpc52xx-psc.c
spi-mpc52xx.c
spi-mpc512x-psc.c
spi-mt65xx.c spi: mediatek: Avoid NULL pointer crash in interrupt 2022-02-08 18:30:37 +01:00
spi-mt7621.c spi: mt7621: Fix an error message in mt7621_spi_probe() 2022-10-26 13:25:19 +02:00
spi-mtk-nor.c spi: spi-mtk-nor: initialize spi controller after resume 2022-04-27 13:53:48 +02:00
spi-mux.c spi: spi-mux: Add module info needed for autoloading 2021-08-26 08:35:35 -04:00
spi-mxic.c spi: mxic: Fix the transmit path 2022-04-08 14:39:51 +02:00
spi-mxs.c spi: mxs: fix reference leak in mxs_spi_probe 2020-12-30 11:53:15 +01:00
spi-npcm-fiu.c spi: npcm-fiu: Disable clock in probe error path 2020-12-30 11:54:21 +01:00
spi-npcm-pspi.c spi: npcm-pspi: Convert to use GPIO descriptors 2020-07-01 23:21:28 +01:00
spi-nxp-fspi.c spi: spi-nxp-fspi: move the register operation after the clock enable 2021-06-30 08:47:17 -04:00
spi-oc-tiny.c SPI SUBSYSTEM: Replace HTTP links with HTTPS ones 2020-07-09 22:41:11 +01:00
spi-omap-100k.c spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe 2022-10-26 13:25:22 +02:00
spi-omap-uwire.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-omap2-mcspi.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-orion.c spi: Fix SPI NOR and SPI NAND acronyms 2020-07-17 00:55:25 +01:00
spi-pic32-sqi.c
spi-pic32.c spi: spi-pic32: Fix issue with uninitialized dma_slave_config 2021-09-15 09:50:28 +02:00
spi-pl022.c amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
spi-ppc4xx.c spi: ppc4xx: Convert to use GPIO descriptors 2020-07-22 01:55:52 +01:00
spi-pxa2xx-dma.c
spi-pxa2xx-pci.c spi: pxa2xx-pci: Balance reference count for PCI DMA device 2022-04-08 14:40:00 +02:00
spi-pxa2xx.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-pxa2xx.h
spi-qcom-qspi.c spi: spi-qcom-qspi: Fix use-after-free on unbind 2020-12-30 11:54:21 +01:00
spi-qup.c spi: qup: Don't skip cleanup in remove's error path 2023-05-17 11:47:56 +02:00
spi-rb4xx.c spi: rb4xx: Don't leak SPI master in probe error path 2020-12-30 11:54:21 +01:00
spi-rockchip.c spi: rockchip: terminate dma transmission when slave abort 2022-03-16 14:16:00 +01:00
spi-rpc-if.c spi: spi-rpc-if: Check return value of rpcif_sw_init() 2021-11-18 14:04:11 +01:00
spi-rspi.c spi: spi-rspi: Fix PIO fallback on RZ platforms 2022-08-21 15:15:31 +02:00
spi-s3c24xx-regs.h ARM: s3c24xx: move regs-spi.h into spi driver 2020-08-19 21:40:14 +02:00
spi-s3c24xx.c ARM: SoC platform updates 2020-10-24 10:33:08 -07:00
spi-s3c64xx.c spi: s3c64xx: Fix large transfers with DMA 2022-10-26 13:25:22 +02:00
spi-sc18is602.c spi: sc18is602: Don't leak SPI master in probe error path 2020-12-30 11:54:21 +01:00
spi-sh-hspi.c
spi-sh-msiof.c
spi-sh-sci.c
spi-sh.c spi: spi-sh: Fix use-after-free on unbind 2020-12-30 11:54:20 +01:00
spi-sifive.c
spi-sirf.c
spi-slave-mt27xx.c
spi-slave-system-control.c
spi-slave-time.c
spi-sprd-adi.c spi: sprd: Fix the wrong WDG_LOAD_VAL 2021-09-15 09:50:30 +02:00
spi-sprd.c spi: sprd: Add missing MODULE_DEVICE_TABLE 2021-06-16 12:01:35 +02:00
spi-st-ssc4.c spi: st-ssc4: Fix unbalanced pm_runtime_disable() in probe error path 2020-12-30 11:54:21 +01:00
spi-stm32-qspi.c spi: stm32-qspi: Fix wait_cmd timeout in APM mode 2022-06-09 10:20:54 +02:00
spi-stm32.c spi: stm32: fix stm32_spi_prepare_mbr() that halves spi clk for every run 2022-12-02 17:39:58 +01:00
spi-sun4i.c spi: sun4i: update max transfer size reported 2020-07-27 14:55:21 +01:00
spi-sun6i.c spi: spi-sun6i: Fix chipselect/clock bug 2021-07-14 16:56:10 +02:00
spi-synquacer.c spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one() 2023-03-11 16:39:38 +01:00
spi-tegra20-sflash.c spi: tegra20-sflash: fix reference leak in tegra_sflash_resume 2020-12-30 11:53:05 +01:00
spi-tegra20-slink.c spi: tegra20: Use of_device_get_match_data() 2022-04-08 14:40:32 +02:00
spi-tegra114.c spi: tegra114: Add missing IRQ check in tegra_spi_probe 2022-04-08 14:39:59 +02:00
spi-test.h
spi-ti-qspi.c spi: spi-ti-qspi: Fix return value handling of wait_for_completion_timeout 2022-06-09 10:21:01 +02:00
spi-tle62x0.c
spi-topcliff-pch.c spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages() 2021-07-14 16:55:50 +02:00
spi-txx9.c
spi-uniphier.c spi: uniphier: fix reference count leak in uniphier_spi_probe() 2022-02-08 18:30:37 +01:00
spi-xcomm.c
spi-xilinx.c spi: xilinx: Fix info message during probe 2020-09-17 19:56:01 +01:00
spi-xlp.c
spi-xtensa-xtfpga.c
spi-zynq-qspi.c spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op() 2022-03-02 11:42:52 +01:00
spi-zynqmp-gqspi.c spi: spi-zynqmp-gqspi: Handle error for dma_set_mask 2022-04-08 14:40:01 +02:00
spi.c spi: Ensure that sg_table won't be used after being freed 2022-10-26 13:25:23 +02:00
spidev.c spi: spidev: remove debug messages that access spidev->spi without locking 2023-02-01 08:23:17 +01:00