All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: spi-ti-qspi: Suspend the queue before removing the device
@ 2016-05-17 11:57 Jean-Jacques Hiblot
       [not found] ` <1463486227-6110-1-git-send-email-x0248073-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Jacques Hiblot @ 2016-05-17 11:57 UTC (permalink / raw)
  To: linux-spi-u79uwXL29TY76Z2rM5mHXA
  Cc: vigneshr-l0cyMroinI0, Jean-Jacques Hiblot

From: Jean-Jacques Hiblot <jjhiblot-l0cyMroinI0@public.gmane.org>

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-l0cyMroinI0@public.gmane.org>
---
 drivers/spi/spi-ti-qspi.c | 7 +++++++
 1 file changed, 7 insertions(+)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-31 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17 11:57 [PATCH] spi: spi-ti-qspi: Suspend the queue before removing the device Jean-Jacques Hiblot
     [not found] ` <1463486227-6110-1-git-send-email-x0248073-l0cyMroinI0@public.gmane.org>
2016-05-31 14:45   ` Jean-Jacques Hiblot
     [not found]     ` <574DA3A1.9020307-l0cyMroinI0@public.gmane.org>
2016-05-31 15:18       ` Mark Brown
     [not found]         ` <20160531151821.GE29837-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-05-31 15:33           ` Jean-Jacques Hiblot
     [not found]             ` <574DAEC3.4040605-l0cyMroinI0@public.gmane.org>
2016-05-31 15:37               ` Mark Brown
2016-05-31 17:52   ` Applied "spi: spi-ti-qspi: Suspend the queue before removing the device" to the spi tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.