Skip to contentSkip to conversation

spi: spi-ti-qspi: Suspend the queue before removing the device

PATCH RESEND In review Jean-Jacques Hiblot 2 participants 2 messages May 31, 2016 1 message not in the archive SPI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 spi: spi-ti-qspi: Suspend the queue before removing the device

From: Jean-Jacques Hiblot <[email protected]>

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.

---

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(+)
drivers/spi/spi-ti-qspi.c +7 -0
index 443f664..29ea8d2 100644
@@ -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);
 
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1464710183-7826-1-git-send-email-x0248073-l0cyMroinI0@public.gmane.org

#2 lore raw
Quoted 1 line · Jean-Jacques Hiblot

From: Jean-Jacques Hiblot <[email protected]>

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.