Skip to contentSkip to conversation

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

PATCH Superseded Jean-Jacques Hiblot 3 participants 6 messages May 17, 2016 – May 31, 2016 4 messages not in the archive SPI

lore
Share & tools
lore
#0 lore raw

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

---
 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
#2 lore raw
In reply to a message not in the archive

gentle ping.

Any objection to fix this particular issue in this way ? Should it be fixed at the core level ?

Thanks,

Jean-Jacques

Quoted 21 lines · Jean-Jacques Hiblot

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.

---
  drivers/spi/spi-ti-qspi.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/spi/spi-ti-qspi.c +0 -0
index 443f664..29ea8d2 100644
@@ -646,6 +646,13 @@ free_master:
 
  static int ti_qspi_remove(struct platform_device *pdev)
  {

drivers/spi/spi-ti-qspi.c free_master: · line 658

Quoted 10 lines
drivers/spi/spi-ti-qspi.c +7 -0
+	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);
 

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

#4 lore raw
In reply to a message not in the archive
Quoted 4 lines · Jean-Jacques Hiblot

gentle ping.

Any objection to fix this particular issue in this way ? Should it be fixed at the core level ?

Please don't send content free pings and please allow a reasonable time for review. People get busy, go on holiday, attend conferences and so on so unless there is some reason for urgency (like critical bug fixes) please allow at least a couple of weeks for review. If there have been review comments then people may be waiting for those to be addressed. Sending content free pings just adds to the mail volume (if they are seen at all) and if something has gone wrong you'll have to resend the patches anyway.

In this case you've never sent me the patch so I've not seen it.

Please don't top post, reply in line with needed context. This allows readers to readily follow the flow of conversation and understand what you are talking about and also helps ensure that everything in the discussion is being addressed.

#6 lore raw
In reply to a message not in the archive
Quoted 14 lines · Mark Brown
Quoted 4 lines · Jean-Jacques Hiblot

gentle ping.

Any objection to fix this particular issue in this way ? Should it be fixed at the core level ?

Please don't send content free pings and please allow a reasonable time for review. People get busy, go on holiday, attend conferences and so on so unless there is some reason for urgency (like critical bug fixes) please allow at least a couple of weeks for review. If there have been review comments then people may be waiting for those to be addressed. Sending content free pings just adds to the mail volume (if they are seen at all) and if something has gone wrong you'll have to resend the patches anyway.

Quoted 1 line

In this case you've never sent me the patch so I've not seen it.

I had just noticed that I forgot to add you in the loop. That's actually the reason why I sent the ping, not to push you.

Jean-Jacques

Quoted 5 lines

Please don't top post, reply in line with needed context. This allows readers to readily follow the flow of conversation and understand what you are talking about and also helps ensure that everything in the discussion is being addressed.

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

#8 lore raw
In reply to a message not in the archive
Quoted 6 lines · Jean-Jacques Hiblot
Quoted 1 line · Mark Brown

In this case you've never sent me the patch so I've not seen it.

I had just noticed that I forgot to add you in the loop. That's actually the reason why I sent the ping, not to push you.

I can't apply patches that are quoted in replies to other messages, please send the patch again.

#9 lore raw

Applied "spi: spi-ti-qspi: Suspend the queue before removing the device" to the spi tree

In reply to a message not in the archive

The patch

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

has been applied to the spi tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 3ac066e2227cb272c097f34475247fa0a6cdd2ff Mon Sep 17 00:00:00 2001

From: Jean-Jacques Hiblot <[email protected]>
Date: Tue, 31 May 2016 17:56:23 +0200
Subject: [PATCH] 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.

---
 drivers/spi/spi-ti-qspi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/spi/spi-ti-qspi.c +7 -0
index 443f664534e1..29ea8d2f9824 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
2.8.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