[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0PR01MB5922BF4F1DB81E97926499E786FB9@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date: Tue, 26 Apr 2022 13:48:05 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>
CC: Geert Uytterhoeven <geert+renesas@...der.be>,
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>,
Pavel Machek <pavel@...x.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
Prabhakar <prabhakar.csengg@...il.com>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: RE: [PATCH v2 3/3] ASoC: sh: rz-ssi: Release the DMA channels in
rz_ssi_probe() error path
Hi Lad Prabhakar,
Thanks for the patch.
> Subject: [PATCH v2 3/3] ASoC: sh: rz-ssi: Release the DMA channels in
> rz_ssi_probe() error path
>
> 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@...x.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> ---
> v1->v2
> * Dropped devers action and instead called rz_ssi_release_dma_channels()
> in the error path.
> ---
> 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
> d9a684e71ec3..e392de7a262e 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);
> + }
May be we could move reset handle get above DMA channel request??
Cheers,
Biju
>
> 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
Powered by blists - more mailing lists