ソースを参照

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>
Jean-Jacques Hiblot 9 年 前
コミット
3ac066e222
1 ファイル変更7 行追加0 行削除
  1. 7 0
      drivers/spi/spi-ti-qspi.c

+ 7 - 0
drivers/spi/spi-ti-qspi.c

@@ -646,6 +646,13 @@ static int ti_qspi_probe(struct platform_device *pdev)
 
 
 static int ti_qspi_remove(struct platform_device *pdev)
 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_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);