linux-stable/drivers/spi
Mirko Vogt c43082d284 spi: spi-sun6i: Fix chipselect/clock bug
[ Upstream commit 0d7993b234 ]

The current sun6i SPI implementation initializes the transfer too early,
resulting in SCK going high before the transfer. When using an additional
(gpio) chipselect with sun6i, the chipselect is asserted at a time when
clock is high, making the SPI transfer fail.

This is due to SUN6I_GBL_CTL_BUS_ENABLE being written into
SUN6I_GBL_CTL_REG at an early stage. Moving that to the transfer
function, hence, right before the transfer starts, mitigates that
problem.

Fixes: 3558fe900e (spi: sunxi: Add Allwinner A31 SPI controller driver)
Signed-off-by: Mirko Vogt <mirko-dev|linux@nanl.de>
Signed-off-by: Ralf Schlatterbeck <rsc@runtux.com>
Link: https://lore.kernel.org/r/20210614144507.y3udezjfbko7eavv@runtux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:10 +02:00
..
atmel-quadspi.c spi: atmel-quadspi: Fix AHB memory accesses 2020-12-30 11:54:22 +01:00
internals.h
Kconfig spi: dw-bt1: Fix undefined devm_mux_control_get symbol 2021-01-06 14:56:49 +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: spi-amd: Do not define 'struct acpi_device_id' when !CONFIG_ACPI 2020-07-17 16:38:56 +01: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: a3700: Remove a useless memset 2020-08-18 17:52:37 +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 use-after-free on unbind 2020-11-12 15:05:37 +00:00
spi-bcm-qspi.h
spi-bcm63xx-hsspi.c spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume 2020-12-30 11:53:06 +01:00
spi-bcm63xx.c
spi-bcm2835.c spi: bcm2835: Fix out-of-bounds access with more than 4 slaves 2021-06-16 12:01:39 +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: set cqspi to the driver_data field of struct device 2021-03-25 09:04:04 +01:00
spi-cadence.c spi: cadence: cache reference clock rate during probe 2021-01-23 16:04:05 +01:00
spi-cavium-octeon.c
spi-cavium-thunderx.c
spi-cavium.c
spi-cavium.h
spi-clps711x.c
spi-coldfire-qspi.c spi: coldfire-qspi: Use clk_prepare_enable and clk_disable_unprepare 2020-07-17 00:55:26 +01:00
spi-davinci.c spi: davinci: Fix use-after-free on unbind 2020-12-30 11:54:20 +01: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: Avoid stack content exposure 2021-03-04 11:38:07 +01:00
spi-dw-core.c spi: dw: Fix spi registration for controllers overriding CS 2020-11-25 12:54:05 +00:00
spi-dw-dma.c spi: dw: Add generic DW SSI status-check method 2020-10-08 23:00:18 +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 treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
spi-fsl-cpm.h
spi-fsl-dspi.c spi: spi-fsl-dspi: Fix a resource leak in an error handling path 2021-06-03 09:00:37 +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: Fix SPI NOR and SPI NAND acronyms 2020-07-17 00:55:25 +01:00
spi-fsl-spi.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02: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: gpio: Don't leak SPI master in probe error path 2020-12-30 11:54:20 +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 reference leak in img_spfi_resume 2020-12-30 11:53:01 +01:00
spi-imx.c spi: imx: Don't print error on -EPROBEDEFER 2021-03-04 11:37:58 +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 spi: spi-loopback-test: Fix 'tx_buf' might be 'rx_buf' 2021-07-14 16:55:49 +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: fix memory leak in meson_spicc_probe 2021-07-14 16:55:54 +02:00
spi-meson-spifc.c spi: spi-meson-spifc: Fix misdocumenting of 'dev' in 'struct meson_spifc' 2020-07-17 16:38:48 +01:00
spi-mpc52xx-psc.c
spi-mpc52xx.c
spi-mpc512x-psc.c
spi-mt65xx.c spi: mediatek: add spi support for mt8192 IC 2020-07-22 01:56:00 +01:00
spi-mt7621.c spi: mt7621: Don't leak SPI master in probe error path 2020-12-30 11:54:22 +01:00
spi-mtk-nor.c spi: spi-mtk-nor: Don't leak SPI master in probe error path 2020-12-30 11:54:20 +01:00
spi-mux.c spi: spi-mux: Simplify with dev_err_probe() 2020-09-08 18:19:27 +01:00
spi-mxic.c spi: mxic: Don't leak SPI master in probe error path 2020-12-30 11:54:20 +01: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: omap-100k: Fix the length judgment problem 2021-07-14 16:55:50 +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: pic32: Don't leak DMA channels in probe error path 2020-12-30 11:54:21 +01:00
spi-pl022.c spi: spi-pl022: Provide missing struct attribute/function param docs 2020-07-17 16:38:50 +01: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: Fix the controller numbering for Wildcat Point 2021-03-04 11:38:06 +01: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: fix PM reference leak in spi_qup_remove() 2021-05-11 14:47:20 +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: avoid objtool warning 2021-05-14 09:50:09 +02:00
spi-rpc-if.c spi: rpc-if: Fix use-after-free on unbind 2020-12-30 11:54:21 +01:00
spi-rspi.c spi: rspi: Fill in controller speed limits 2020-08-20 22:38:17 +01: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: spi-s3c64xx: Turn on interrupts upon resume 2020-10-02 21:54:24 +01: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: Simplify with dev_err_probe() 2020-09-14 15:50:17 +01: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: Always wait BUSY bit to be cleared in stm32_qspi_wait_cmd() 2021-06-23 14:42:48 +02:00
spi-stm32.c spi: stm32: Fix use-after-free on unbind 2021-05-14 09:50:11 +02: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: spi-synquacer: fix set_cs handling 2021-03-04 11:38:43 +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-slink: fix reference leak in slink ops of tegra20 2020-12-30 11:53:05 +01:00
spi-tegra114.c spi: tegra114: fix reference leak in tegra spi ops 2020-12-30 11:53:06 +01:00
spi-test.h
spi-ti-qspi.c spi: spi-ti-qspi: Free DMA resources 2021-05-11 14:47:13 +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-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 some wrong goto jumps & missing error code 2021-06-23 14:42:48 +02:00
spi-zynqmp-gqspi.c spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails 2021-05-14 09:50:20 +02:00
spi.c spi: Avoid undefined behaviour when counting unused native CSs 2021-07-14 16:56:02 +02:00
spidev.c spi: spidev: Remove redundant initialization of variable status 2020-09-09 16:27:46 +01:00