linux-stable/drivers/spi
Tony Lindgren 5a686b2c9e
spi: omap2-mcspi: Idle hardware during suspend and resume
We currently are calling mcspi suspend and resume without considering
that mcspi might provide resources for other device driver such as
regulators. This means resume can fail and will produce -EACCES if
errors if anything calls mcspi functions between device_prepare()
and device_complete().

To fix the issue, let's do the following changes:

1. Let's add checking for return values for pm_runtime_get calls,
   and call pm_runtime_put_noidle() on errors. Things still fail
   after this change, but at least we see something is wrong as
   we now see -EACCES errors on resume.

2. Let's use noirq level for suspend and resume as other drivers
   can still call SPI related functions on suspend and resume. This
   still won't fix the -EACCES issue, but gets us to something a bit
   saner.

3. Finally, let's modify suspend and resume to call to make sure
   the device is idled properly on suspend. We have device_prepare()
   call pm_runtime_get_noresume() that won't get released until in
   device_complete() when it calls pm_runtime_put(). So if SPI is
   still active on entering suspend, it will never get idled unless
   we add calls to pm_runtime_force_suspend() and resume. This also
   fixes the -EACCES errors on resume together with changes 1 and 2
   above.

And since we're already rewriting suspend resume functions, let's
arrange the order of suspend and resume functions to be like they
usually are with suspend first.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-02 06:06:17 +09:00
..
internals.h spi: Add an helper to flush the message queue 2018-04-23 15:48:18 +01:00
Kconfig spi: Remove depends on HAS_DMA in case of platform dependency 2018-04-18 11:28:19 +01:00
Makefile spi: remove blackfin related host drivers 2018-03-26 15:57:05 +02:00
spi-altera.c spi: altera: Consolidate TX/RX data register access 2017-08-16 11:53:31 +01:00
spi-armada-3700.c Merge remote-tracking branches 'spi/topic/a3700', 'spi/topic/atmel', 'spi/topic/bcm53xx', 'spi/topic/davinci' and 'spi/topic/dw' into spi-next 2018-01-26 17:57:24 +00:00
spi-ath79.c spi/ath79: Fix checkpatch warnings 2017-07-17 12:09:38 +01:00
spi-atmel.c spi: spi-atmel: Use correct enum for DMA transfer direction 2018-03-28 10:42:48 +08:00
spi-au1550.c
spi-axi-spi-engine.c spi: spi-axi: fix potential use-after-free after deregistration 2017-10-31 11:15:10 +00:00
spi-bcm-qspi.c spi: bcm-qspi: fIX some error handling paths 2018-03-14 09:37:28 -07:00
spi-bcm-qspi.h
spi-bcm53xx.c spi: bcm53xx: simplify reading SPI data 2018-01-03 11:39:16 +00:00
spi-bcm53xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spi-bcm63xx-hsspi.c spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate(). 2018-04-26 12:41:22 +01:00
spi-bcm63xx.c spi/bcm63xx: fix error return code in bcm63xx_spi_probe() 2017-08-08 11:36:35 +01:00
spi-bcm2835.c
spi-bcm2835aux.c spi: bcm2835aux: Avoid 64-bit arithmetic in xfer len calc 2018-02-14 16:04:58 +00:00
spi-bitbang-txrx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spi-bitbang.c
spi-brcmstb-qspi.c
spi-butterfly.c
spi-cadence.c spi: simplify getting .drvdata 2018-04-20 17:53:20 +01:00
spi-cavium-octeon.c
spi-cavium-thunderx.c
spi-cavium.c
spi-cavium.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spi-clps711x.c
spi-coldfire-qspi.c
spi-davinci.c spi: davinci: Initialize dspi->done before any possible use of it 2017-12-12 10:51:52 +00:00
spi-dln2.c
spi-dw-mid.c spi: dw: Convert to generalized SPI controller API 2018-02-12 12:04:16 +00:00
spi-dw-mmio.c spi: dw: Disable clock after unregistering the host 2017-04-18 19:16:49 +01:00
spi-dw-pci.c
spi-dw.c spi: dw: Convert to generalized SPI controller API 2018-02-12 12:04:16 +00:00
spi-dw.h spi: dw: Convert to generalized SPI controller API 2018-02-12 12:04:16 +00:00
spi-efm32.c
spi-ep93xx.c spi: spi-ep93xx: use the default master transfer queueing mechanism 2017-08-09 17:53:14 +01:00
spi-falcon.c spi: spi-falcon: drop check of boot select 2017-09-01 11:33:22 +01:00
spi-fsl-cpm.c
spi-fsl-cpm.h
spi-fsl-dspi.c spi: spi-fsl-dspi: account for const type of of_device_id.data 2018-01-03 12:19:24 +00:00
spi-fsl-espi.c
spi-fsl-lib.c
spi-fsl-lib.h
spi-fsl-lpspi.c
spi-fsl-spi.c Merge remote-tracking branches 'spi/topic/devprop', 'spi/topic/fsl', 'spi/topic/fsl-dspi', 'spi/topic/imx' and 'spi/topic/lantiq' into spi-next 2017-04-26 15:58:04 +01:00
spi-fsl-spi.h
spi-gpio.c spi: spi-gpio: Rewrite to use GPIO descriptors 2018-02-14 16:02:41 +00:00
spi-img-spfi.c
spi-imx.c spi: imx: Update MODULE_DESCRIPTION to "SPI Controller driver" 2018-04-13 12:18:15 +01:00
spi-iproc-qspi.c
spi-jcore.c spi: jcore: disable ref_clk after getting its rate 2018-03-18 17:57:42 -07:00
spi-lantiq-ssc.c Merge remote-tracking branches 'spi/topic/devprop', 'spi/topic/fsl', 'spi/topic/fsl-dspi', 'spi/topic/imx' and 'spi/topic/lantiq' into spi-next 2017-04-26 15:58:04 +01:00
spi-lm70llp.c
spi-loopback-test.c spi: loopback-test: implement testing with no CS 2017-07-26 13:08:56 +01:00
spi-lp8841-rtc.c
spi-meson-spicc.c spi: meson-spicc: Fix error handling in meson_spicc_probe() 2018-05-02 05:59:21 +09:00
spi-meson-spifc.c
spi-mpc52xx-psc.c
spi-mpc52xx.c spi: mpc52xx: Use gpio_is_valid() 2018-04-27 12:05:39 +01:00
spi-mpc512x-psc.c
spi-mt65xx.c spi: mediatek: add spi support for mt2712 IC 2017-06-20 13:39:14 +01:00
spi-mxs.c spi: mxs: implement runtime pm 2017-09-27 10:02:57 -07:00
spi-nuc900.c
spi-oc-tiny.c
spi-omap-100k.c
spi-omap-uwire.c
spi-omap2-mcspi.c spi: omap2-mcspi: Idle hardware during suspend and resume 2018-05-02 06:06:17 +09:00
spi-orion.c spi: orion: Prepare space for per-child options 2018-02-15 15:19:58 +00:00
spi-pic32-sqi.c
spi-pic32.c spi: pic32: fix spelling mistakes on macro names 2017-07-26 13:04:21 +01:00
spi-pl022.c spi: pl022: constify amba_id 2017-08-23 17:12:05 +01:00
spi-ppc4xx.c
spi-pxa2xx-dma.c spi: pxa2xx: Use core message processing loop 2018-04-17 17:11:30 +01:00
spi-pxa2xx-pci.c spi: pca2xx-pci: Allow MSI 2017-01-23 18:09:37 +00:00
spi-pxa2xx.c spi: pxa2xx: pxa2xx_spi_transfer_one() can be static 2018-04-18 12:01:35 +01:00
spi-pxa2xx.h spi: pxa2xx: Allow 64-bit DMA 2018-04-19 18:17:46 +01:00
spi-qup.c spi: qup: fix 64-bit build warning 2017-08-10 15:50:23 +01:00
spi-rb4xx.c
spi-rockchip.c spi: rockchip: configure CTRLR1 according to size and data frame 2017-08-16 11:58:23 +01:00
spi-rspi.c spi: rspi: use correct enum for DMA transfer direction 2018-03-20 09:02:12 +08:00
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c
spi-s3c64xx.c spi: s3c64xx: samsung: Remove support for Exynos5440 2018-04-25 13:52:02 +01:00
spi-sc18is602.c spi: sc18is602: Add OF device ID table 2017-02-22 10:50:09 -08:00
spi-sh-hspi.c
spi-sh-msiof.c spi: sh-msiof: Simplify calculation of divisors for transfer rate 2018-04-17 11:46:52 +01:00
spi-sh-sci.c
spi-sh.c spi: spi-sh: fix error return code in spi_sh_probe() 2017-08-09 17:18:06 +01:00
spi-sirf.c spi: sirf: account for const type of of_device_id.data 2018-01-03 11:38:46 +00:00
spi-slave-system-control.c spi: slave: Add SPI slave handler controlling system state 2017-05-26 13:12:19 +01:00
spi-slave-time.c spi: slave: Add SPI slave handler reporting uptime at previous message 2017-05-26 13:12:04 +01:00
spi-sprd-adi.c spi: sprd: Add the support of restarting the system 2018-03-21 09:55:19 +08:00
spi-st-ssc4.c spi: st-ssc4: whitespace cleanup 2017-05-26 12:41:07 +01:00
spi-stm32.c spi: stm32: Fix error handling in stm32_spi_probe() 2018-04-17 11:46:23 +01:00
spi-sun4i.c spi: sun4i: disable clocks in the remove function 2017-12-07 11:59:15 +00:00
spi-sun6i.c spi: sun6i: disable/unprepare clocks on remove 2017-12-07 17:45:17 +00:00
spi-tegra20-sflash.c spi: tegra20-sflash: explicitly request exclusive reset control 2017-07-19 17:06:31 +01:00
spi-tegra20-slink.c spi: tegra20-slink: use true and false for boolean values 2018-03-06 14:20:37 +00:00
spi-tegra114.c spi: tegra114: correct register name in definition 2017-10-09 10:16:38 +01:00
spi-test.h spi: loopback-test: add elapsed time check 2017-03-17 21:54:08 +00:00
spi-ti-qspi.c Merge remote-tracking branches 'spi/topic/ti-qspi' and 'spi/topic/xlp' into spi-next 2017-04-26 15:58:22 +01:00
spi-tle62x0.c
spi-topcliff-pch.c spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx() 2017-01-17 18:38:02 +00:00
spi-txx9.c
spi-xcomm.c
spi-xilinx.c spi: xilinx: Add support for xlnx,axi-quad-spi-1.00.a 2017-11-27 16:31:20 +00:00
spi-xlp.c spi: xlp: fix error return code in xlp_spi_probe() 2017-08-08 11:36:07 +01:00
spi-xtensa-xtfpga.c
spi-zynqmp-gqspi.c spi: simplify getting .drvdata 2018-04-20 17:53:20 +01:00
spi.c spi: Check presence the of ->transfer[_xxx]() before registering a controller 2018-04-26 13:53:29 +01:00
spidev.c Merge branch 'for-spi' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-08 10:41:53 -07:00