All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Chris Paterson <chris.paterson2@renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [PATCH 5.10.y-cip 16/24] ASoC: sh: rz-ssi: Release the DMA channels in rz_ssi_probe() error path
Date: Fri, 15 Jul 2022 08:22:36 +0100	[thread overview]
Message-ID: <20220715072244.2298757-17-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20220715072244.2298757-1-biju.das.jz@bp.renesas.com>

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

commit 767e6f26204d3f5406630e86b720d01818b8616d upstream.

DMA channels requested by rz_ssi_dma_request() in rz_ssi_probe() were
never released in the error path apart from one place. This patch fixes
this issue by calling rz_ssi_release_dma_channels() in the error path.

Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20220426074922.13319-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 sound/soc/sh/rz-ssi.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index caeb236b8372..ae57c7aa580e 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -976,14 +976,18 @@ static int rz_ssi_probe(struct platform_device *pdev)
 
 	/* Error Interrupt */
 	ssi->irq_int = platform_get_irq_byname(pdev, "int_req");
-	if (ssi->irq_int < 0)
+	if (ssi->irq_int < 0) {
+		rz_ssi_release_dma_channels(ssi);
 		return ssi->irq_int;
+	}
 
 	ret = devm_request_irq(&pdev->dev, ssi->irq_int, &rz_ssi_interrupt,
 			       0, dev_name(&pdev->dev), ssi);
-	if (ret < 0)
+	if (ret < 0) {
+		rz_ssi_release_dma_channels(ssi);
 		return dev_err_probe(&pdev->dev, ret,
 				     "irq request error (int_req)\n");
+	}
 
 	if (!rz_ssi_is_dma_enabled(ssi)) {
 		/* Tx and Rx interrupts (pio only) */
@@ -1011,13 +1015,16 @@ static int rz_ssi_probe(struct platform_device *pdev)
 	}
 
 	ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(ssi->rstc))
+	if (IS_ERR(ssi->rstc)) {
+		rz_ssi_release_dma_channels(ssi);
 		return PTR_ERR(ssi->rstc);
+	}
 
 	reset_control_deassert(ssi->rstc);
 	pm_runtime_enable(&pdev->dev);
 	ret = pm_runtime_resume_and_get(&pdev->dev);
 	if (ret < 0) {
+		rz_ssi_release_dma_channels(ssi);
 		pm_runtime_disable(ssi->dev);
 		reset_control_assert(ssi->rstc);
 		return dev_err_probe(ssi->dev, ret, "pm_runtime_resume_and_get failed\n");
-- 
2.25.1



  parent reply	other threads:[~2022-07-15  7:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  7:22 [PATCH 5.10.y-cip 00/24] RZ/G2L Fixes from mainline Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 01/24] soc: renesas: Consolidate product register handling Biju Das
2022-07-25 21:04   ` Pavel Machek
2022-07-26  9:16     ` Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 02/24] dt-bindings: power: renesas,rzg2l-sysc: Document RZ/V2L SoC Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 03/24] soc: renesas: Identify " Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 04/24] soc: renesas: Add support for reading product revision for RZ/G2L family Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 05/24] soc: renesas: Kconfig: Explicitly select PM and PM_GENERIC_DOMAINS configs Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 06/24] soc: renesas: Kconfig: Introduce ARCH_RZG2L config option Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 07/24] ASoC: sh: Make SND_SOC_RZ depend on ARCH_RZG2L Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 08/24] iio: adc: Kconfig: Make RZG2L_ADC " Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 09/24] dt-bindings: dma: rz-dmac: Document RZ/V2L SoC Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 10/24] dmaengine: sh: Kconfig: Add ARCH_R9A07G054 dependency for RZ_DMAC config option Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 11/24] dmaengine: sh: Kconfig: Make RZ_DMAC depend on ARCH_RZG2L Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 12/24] reset: Kconfig: Make RESET_RZG2L_USBPHY_CTRL " Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 13/24] dt-bindings: pinctrl: renesas,rzg2l-pinctrl: Add description for power-source property Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 14/24] ASoC: sh: rz-ssi: Drop SSIFSR_TDC and SSIFSR_RDC macros Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 15/24] ASoC: sh: rz-ssi: Propagate error codes returned from platform_get_irq_byname() Biju Das
2022-07-15  7:22 ` Biju Das [this message]
2022-07-25 21:00   ` [PATCH 5.10.y-cip 16/24] ASoC: sh: rz-ssi: Release the DMA channels in rz_ssi_probe() error path Pavel Machek
2022-07-26  9:26     ` [cip-dev] " Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 17/24] iio: adc: rzg2l_adc: Remove unnecessary print function dev_err() Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 18/24] iio: adc: rzg2l_adc: Fix typo Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 19/24] iio: adc: rzg2l_adc: add missing fwnode_handle_put() in rzg2l_adc_parse_properties() Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 20/24] reset: renesas: Fix Runtime PM usage Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 21/24] reset: renesas: Check return value of reset_control_deassert() Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 22/24] i2c: riic: Simplify reset handling Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 23/24] arm64: dts: renesas: Fix pin controller node names Biju Das
2022-07-15  7:22 ` [PATCH 5.10.y-cip 24/24] arm64: dts: renesas: rzg2l-smarc: Move pinctrl definitions Biju Das
2022-07-25 20:53   ` [cip-dev] " Pavel Machek
2022-07-26  9:20     ` Biju Das
2022-07-26 11:51       ` Pavel Machek
2022-07-26 12:12         ` Biju Das
2022-07-25 21:05 ` [PATCH 5.10.y-cip 00/24] RZ/G2L Fixes from mainline Pavel Machek
2022-07-26  8:49 ` nobuhiro1.iwamatsu
2022-07-26 11:50   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220715072244.2298757-17-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=chris.paterson2@renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.