diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2016-05-31 17:56:23 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-05-31 18:51:58 +0100 |
commit | 3ac066e2227cb272c097f34475247fa0a6cdd2ff (patch) | |
tree | 047dcf783c7a8b2523b51223ae399a38105ae6ca /drivers/spi/spi-ti-qspi.c | |
parent | 1a695a905c18548062509178b98bc91e67510864 (diff) | |
download | op-kernel-dev-3ac066e2227cb272c097f34475247fa0a6cdd2ff.zip op-kernel-dev-3ac066e2227cb272c097f34475247fa0a6cdd2ff.tar.gz |
spi: spi-ti-qspi: Suspend the queue before removing the device
Before disabling the pm_runtime, we must ensure that there is no transfer
in progress nor will a new one be started. Otherwise the message pump will
fail and in the end, the process requesting the transfer will be stuck.
This behavior has been observed when transferring data from a SPI flash
with dd while removing the module on a DRA7x-evm.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-ti-qspi.c')
-rw-r--r-- | drivers/spi/spi-ti-qspi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 443f664..29ea8d2 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -646,6 +646,13 @@ free_master: static int ti_qspi_remove(struct platform_device *pdev) { + struct ti_qspi *qspi = platform_get_drvdata(pdev); + int rc; + + rc = spi_master_suspend(qspi->master); + if (rc) + return rc; + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); |