All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] spi: tegra20-slink: Put device into suspend on driver removal
@ 2021-10-23 22:59 Dmitry Osipenko
  2021-10-23 22:59 ` [PATCH v1 2/2] spi: tegra210-quad: " Dmitry Osipenko
  2021-10-25 16:39 ` [PATCH v1 1/2] spi: tegra20-slink: " Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2021-10-23 22:59 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Mark Brown, Laxman Dewangan,
	Sowjanya Komatineni
  Cc: linux-spi, linux-kernel, linux-tegra

pm_runtime_disable() cancels all pending power requests, while they
should be completed for the Tegra SPI driver. Otherwise SPI clock won't
be disabled ever again because clk refcount will become unbalanced.
Enforce runtime PM suspension to put device into expected state before
driver is unbound and device's RPM state is reset by driver's core.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/spi/spi-tegra20-slink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 33302f6b42d7..e6b16131edc2 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1124,7 +1124,7 @@ static int tegra_slink_probe(struct platform_device *pdev)
 exit_pm_put:
 	pm_runtime_put(&pdev->dev);
 exit_pm_disable:
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_force_suspend(&pdev->dev);
 
 	tegra_slink_deinit_dma_param(tspi, false);
 exit_rx_dma_free:
@@ -1143,7 +1143,7 @@ static int tegra_slink_remove(struct platform_device *pdev)
 
 	free_irq(tspi->irq, tspi);
 
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_force_suspend(&pdev->dev);
 
 	if (tspi->tx_dma_chan)
 		tegra_slink_deinit_dma_param(tspi, false);
-- 
2.32.0


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

* [PATCH v1 2/2] spi: tegra210-quad: Put device into suspend on driver removal
  2021-10-23 22:59 [PATCH v1 1/2] spi: tegra20-slink: Put device into suspend on driver removal Dmitry Osipenko
@ 2021-10-23 22:59 ` Dmitry Osipenko
  2021-10-25 16:39 ` [PATCH v1 1/2] spi: tegra20-slink: " Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2021-10-23 22:59 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Mark Brown, Laxman Dewangan,
	Sowjanya Komatineni
  Cc: linux-spi, linux-kernel, linux-tegra

pm_runtime_disable() cancels all pending power requests, while they
should be completed for the Tegra SPI driver. Otherwise SPI clock won't
be disabled ever again because clk refcount will become unbalanced.
Enforce runtime PM suspension to put device into expected state before
driver is unbound and device's RPM state is reset by driver's core.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/spi/spi-tegra210-quad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 2354ca1e3858..c0f9a75b44b5 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1318,7 +1318,7 @@ static int tegra_qspi_probe(struct platform_device *pdev)
 exit_free_irq:
 	free_irq(qspi_irq, tqspi);
 exit_pm_disable:
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_force_suspend(&pdev->dev);
 	tegra_qspi_deinit_dma(tqspi);
 	return ret;
 }
@@ -1330,7 +1330,7 @@ static int tegra_qspi_remove(struct platform_device *pdev)
 
 	spi_unregister_master(master);
 	free_irq(tqspi->irq, tqspi);
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_force_suspend(&pdev->dev);
 	tegra_qspi_deinit_dma(tqspi);
 
 	return 0;
-- 
2.32.0


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

* Re: [PATCH v1 1/2] spi: tegra20-slink: Put device into suspend on driver removal
  2021-10-23 22:59 [PATCH v1 1/2] spi: tegra20-slink: Put device into suspend on driver removal Dmitry Osipenko
  2021-10-23 22:59 ` [PATCH v1 2/2] spi: tegra210-quad: " Dmitry Osipenko
@ 2021-10-25 16:39 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-10-25 16:39 UTC (permalink / raw)
  To: Thierry Reding, Sowjanya Komatineni, Dmitry Osipenko,
	Jonathan Hunter, Laxman Dewangan
  Cc: Mark Brown, linux-kernel, linux-tegra, linux-spi

On Sun, 24 Oct 2021 01:59:50 +0300, Dmitry Osipenko wrote:
> pm_runtime_disable() cancels all pending power requests, while they
> should be completed for the Tegra SPI driver. Otherwise SPI clock won't
> be disabled ever again because clk refcount will become unbalanced.
> Enforce runtime PM suspension to put device into expected state before
> driver is unbound and device's RPM state is reset by driver's core.
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: tegra20-slink: Put device into suspend on driver removal
      commit: f4bafa944553f606e0f471fadfb64d84afe70fb0
[2/2] spi: tegra210-quad: Put device into suspend on driver removal
      commit: 186640328685ef09d2c575fb26a243d3ac7963aa

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

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

end of thread, other threads:[~2021-10-25 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23 22:59 [PATCH v1 1/2] spi: tegra20-slink: Put device into suspend on driver removal Dmitry Osipenko
2021-10-23 22:59 ` [PATCH v1 2/2] spi: tegra210-quad: " Dmitry Osipenko
2021-10-25 16:39 ` [PATCH v1 1/2] spi: tegra20-slink: " 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.