diff mbox series

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

Message ID 20211109103134.184216-1-alexander.stein@ew.tq-group.com (mailing list archive)
State Accepted
Commit f02bff30114f385d53ae3e45141db602923bca5d
Headers show
Series [1/1] spi: lpspi: release requested DMA channels | expand

Commit Message

Alexander Stein Nov. 9, 2021, 10:31 a.m. UTC
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(-)

Comments

Mark Brown Nov. 12, 2021, 6:17 p.m. UTC | #1
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.
Alexander Stein Nov. 15, 2021, 7:29 a.m. UTC | #2
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
Mark Brown Nov. 15, 2021, 7:21 p.m. UTC | #3
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
diff mbox series

Patch

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