From: Vinod Koul <vkoul@kernel.org>
To: Swati Agarwal <swati.agarwal@xilinx.com>
Cc: lars@metafoo.de, adrianml@alumnos.upm.es, libaokun1@huawei.com,
marex@denx.de, dmaengine@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, harini.katakam@xilinx.com,
radhey.shyam.pandey@xilinx.com, michal.simek@xilinx.com
Subject: Re: [PATCH 1/2] dmaengine: xilinx_dma: Fix probe error cleanup
Date: Fri, 1 Jul 2022 17:20:58 +0530 [thread overview]
Message-ID: <Yr7fou17VkqOYV0V@matsya> (raw)
In-Reply-To: <20220624063539.18657-2-swati.agarwal@xilinx.com>
On 24-06-22, 12:05, Swati Agarwal wrote:
> When probe fails remove dma channel resources and disable clocks in
> accordance with the order of resources allocated .
Ok this looks fine and the changes below..
>
> Add missing cleanup in devm_platform_ioremap_resource(), xlnx,num-fstores
> property.
Where is this part?
>
> Signed-off-by: Swati Agarwal <swati.agarwal@xilinx.com>
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> ---
> drivers/dma/xilinx/xilinx_dma.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index cd62bbb50e8b..fbf341e8c36f 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -3160,8 +3160,10 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>
> /* Request and map I/O memory */
> xdev->regs = devm_platform_ioremap_resource(pdev, 0);
> - if (IS_ERR(xdev->regs))
> - return PTR_ERR(xdev->regs);
> + if (IS_ERR(xdev->regs)) {
> + err = PTR_ERR(xdev->regs);
> + goto disable_clks;
> + }
>
> /* Retrieve the DMA engine properties from the device tree */
> xdev->max_buffer_len = GENMASK(XILINX_DMA_MAX_TRANS_LEN_MAX - 1, 0);
> @@ -3190,7 +3192,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
> if (err < 0) {
> dev_err(xdev->dev,
> "missing xlnx,num-fstores property\n");
> - return err;
> + goto disable_clks;
> }
>
> err = of_property_read_u32(node, "xlnx,flush-fsync",
> @@ -3259,7 +3261,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
> for_each_child_of_node(node, child) {
> err = xilinx_dma_child_probe(xdev, child);
> if (err < 0)
> - goto disable_clks;
> + goto error;
> }
>
> if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
> @@ -3294,12 +3296,12 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>
> return 0;
>
> -disable_clks:
> - xdma_disable_allclks(xdev);
> error:
> for (i = 0; i < xdev->dma_config->max_channels; i++)
> if (xdev->chan[i])
> xilinx_dma_chan_remove(xdev->chan[i]);
> +disable_clks:
> + xdma_disable_allclks(xdev);
>
> return err;
> }
> --
> 2.17.1
--
~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-07-01 11:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 6:35 [PATCH 0/2] dmaengine : xilinx_dma: Fix error handling paths Swati Agarwal
2022-06-24 6:35 ` [PATCH 1/2] dmaengine: xilinx_dma: Fix probe error cleanup Swati Agarwal
2022-07-01 11:50 ` Vinod Koul [this message]
2022-07-12 7:36 ` Agarwal, Swati
2022-07-21 13:36 ` Vinod Koul
2022-06-24 6:35 ` [PATCH 2/2] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Swati Agarwal
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=Yr7fou17VkqOYV0V@matsya \
--to=vkoul@kernel.org \
--cc=adrianml@alumnos.upm.es \
--cc=dmaengine@vger.kernel.org \
--cc=harini.katakam@xilinx.com \
--cc=lars@metafoo.de \
--cc=libaokun1@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=michal.simek@xilinx.com \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=swati.agarwal@xilinx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox