All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] spi: lpspi: release requested DMA channels
@ 2021-11-09 10:31 Alexander Stein
  2021-11-12 18:17 ` Mark Brown
  2021-11-15 19:21 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Stein @ 2021-11-09 10:31 UTC (permalink / raw)
  To: Mark Brown; +Cc: Alexander Stein, linux-spi

The requested DMA channels are never released. Do this in .remove as well
as in .probe. spi_register_controller() can return -EPROBE_DEFER if
cs-gpios are not probed yet.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/spi/spi-fsl-lpspi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index c72e501c270f..4c601294f8fa 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -913,7 +913,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
 	ret = devm_spi_register_controller(&pdev->dev, controller);
 	if (ret < 0) {
 		dev_err_probe(&pdev->dev, ret, "spi_register_controller error: %i\n", ret);
-		goto out_pm_get;
+		goto free_dma;
 	}
 
 	pm_runtime_mark_last_busy(fsl_lpspi->dev);
@@ -921,6 +921,8 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
 
 	return 0;
 
+free_dma:
+	fsl_lpspi_dma_exit(controller);
 out_pm_get:
 	pm_runtime_dont_use_autosuspend(fsl_lpspi->dev);
 	pm_runtime_put_sync(fsl_lpspi->dev);
@@ -937,6 +939,8 @@ static int fsl_lpspi_remove(struct platform_device *pdev)
 	struct fsl_lpspi_data *fsl_lpspi =
 				spi_controller_get_devdata(controller);
 
+	fsl_lpspi_dma_exit(controller);
+
 	pm_runtime_disable(fsl_lpspi->dev);
 	return 0;
 }
-- 
2.25.1


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

* Re: [PATCH 1/1] spi: lpspi: release requested DMA channels
  2021-11-09 10:31 [PATCH 1/1] spi: lpspi: release requested DMA channels Alexander Stein
@ 2021-11-12 18:17 ` Mark Brown
  2021-11-15  7:29   ` (EXT) " Alexander Stein
  2021-11-15 19:21 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2021-11-12 18:17 UTC (permalink / raw)
  To: Alexander Stein; +Cc: linux-spi

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

On Tue, Nov 09, 2021 at 11:31:34AM +0100, Alexander Stein wrote:
> The requested DMA channels are never released. Do this in .remove as well
> as in .probe. spi_register_controller() can return -EPROBE_DEFER if
> cs-gpios are not probed yet.

This doesn't apply against current code, please check and resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: (EXT) Re: [PATCH 1/1] spi: lpspi: release requested DMA channels
  2021-11-12 18:17 ` Mark Brown
@ 2021-11-15  7:29   ` Alexander Stein
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Stein @ 2021-11-15  7:29 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi

Hi Mark,

Am Freitag, dem 12.11.2021 um 18:17 +0000 schrieb Mark Brown:
> * PGP Signed by an unknown key
> 
> On Tue, Nov 09, 2021 at 11:31:34AM +0100, Alexander Stein wrote:
> > The requested DMA channels are never released. Do this in .remove as well
> > as in .probe. spi_register_controller() can return -EPROBE_DEFER if
> > cs-gpios are not probed yet.
> 
> This doesn't apply against current code, please check and resend.

I just noticed there is a dependency to the other patch I sent as well
and which got accepted in commit 12f62a857c83 ("spi: lpspi: Silence
error message upon deferred probe") meanwhile.
I rebased this patch locally to next-20211115 and the newly formatted
patch file is identical to 100%. It should apply now. I can resend it
if you insist, but it is not necessary IMHO.

Best regards,
Alexander



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

* Re: [PATCH 1/1] spi: lpspi: release requested DMA channels
  2021-11-09 10:31 [PATCH 1/1] spi: lpspi: release requested DMA channels Alexander Stein
  2021-11-12 18:17 ` Mark Brown
@ 2021-11-15 19:21 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2021-11-15 19:21 UTC (permalink / raw)
  To: Alexander Stein; +Cc: linux-spi

On Tue, 9 Nov 2021 11:31:34 +0100, Alexander Stein wrote:
> The requested DMA channels are never released. Do this in .remove as well
> as in .probe. spi_register_controller() can return -EPROBE_DEFER if
> cs-gpios are not probed yet.
> 
> 

Applied to

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

Thanks!

[1/1] spi: lpspi: release requested DMA channels
      commit: f02bff30114f385d53ae3e45141db602923bca5d

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] 4+ messages in thread

end of thread, other threads:[~2021-11-16  0:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 10:31 [PATCH 1/1] spi: lpspi: release requested DMA channels Alexander Stein
2021-11-12 18:17 ` Mark Brown
2021-11-15  7:29   ` (EXT) " Alexander Stein
2021-11-15 19:21 ` 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.