diff mbox

[RESEND] spi: spi-ti-qspi: Suspend the queue before removing the device

Message ID 1464710183-7826-1-git-send-email-x0248073@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jean-Jacques Hiblot May 31, 2016, 3:56 p.m. UTC
From: Jean-Jacques Hiblot <jjhiblot@ti.com>

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>
---

Resending because I forgot to add Mark Brown in the loop the first time.
Sorry for the noise.

 drivers/spi/spi-ti-qspi.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Mark Brown May 31, 2016, 5:51 p.m. UTC | #1
On Tue, May 31, 2016 at 05:56:23PM +0200, Jean-Jacques Hiblot wrote:
> From: Jean-Jacques Hiblot <jjhiblot@ti.com>

Please fix your mail configuration and/or signoff such that they come
from the same address - having a patch that looks like it comes from a
different address with only one signoff is a warning sign that they're
wrong.
diff mbox

Patch

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);