From: Vinod Koul <vkoul@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
lars@metafoo.de, dan.j.williams@intel.com,
ardeleanalex@gmail.com
Subject: Re: [PATCH 2/5] dmaengine: axi-dmac: move clock enable earlier
Date: Tue, 25 Aug 2020 16:54:35 +0530 [thread overview]
Message-ID: <20200825112435.GO2639@vkoul-mobl> (raw)
In-Reply-To: <20200819071633.76494-2-alexandru.ardelean@analog.com>
On 19-08-20, 10:16, Alexandru Ardelean wrote:
> The clock may also be required to read registers from the IP core (if it is
> provided and the driver needs to control it).
> So, move it earlier in the probe.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
> drivers/dma/dma-axi-dmac.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
> index 088c79137398..07665c60c21b 100644
> --- a/drivers/dma/dma-axi-dmac.c
> +++ b/drivers/dma/dma-axi-dmac.c
> @@ -850,6 +850,10 @@ static int axi_dmac_probe(struct platform_device *pdev)
> if (IS_ERR(dmac->clk))
> return PTR_ERR(dmac->clk);
>
> + ret = clk_prepare_enable(dmac->clk);
> + if (ret < 0)
> + return ret;
> +
> INIT_LIST_HEAD(&dmac->chan.active_descs);
Change is fine, but then you need to jump to err_clk_disable in few
place below this and not return error
>
> of_channels = of_get_child_by_name(pdev->dev.of_node, "adi,channels");
> @@ -892,10 +896,6 @@ static int axi_dmac_probe(struct platform_device *pdev)
> dmac->chan.vchan.desc_free = axi_dmac_desc_free;
> vchan_init(&dmac->chan.vchan, dma_dev);
>
> - ret = clk_prepare_enable(dmac->clk);
> - if (ret < 0)
> - return ret;
> -
> version = axi_dmac_read(dmac, ADI_AXI_REG_VERSION);
>
> ret = axi_dmac_detect_caps(dmac, version);
> --
> 2.17.1
--
~Vinod
next prev parent reply other threads:[~2020-08-25 11:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 7:16 [PATCH 1/5] dmaengine: axi-dmac: move version read in probe Alexandru Ardelean
2020-08-19 7:16 ` [PATCH 2/5] dmaengine: axi-dmac: move clock enable earlier Alexandru Ardelean
2020-08-25 11:24 ` Vinod Koul [this message]
2020-08-25 12:34 ` Alexandru Ardelean
2020-08-19 7:16 ` [PATCH 3/5] dmaengine: axi-dmac: wrap entire dt parse in a function Alexandru Ardelean
2020-08-25 11:25 ` Vinod Koul
2020-08-19 7:16 ` [PATCH 4/5] dmaengine: axi-dmac: wrap channel parameter adjust into function Alexandru Ardelean
2020-08-19 7:16 ` [PATCH 5/5] dmaengine: axi-dmac: add support for reading bus attributes from registers Alexandru Ardelean
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=20200825112435.GO2639@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=ardeleanalex@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
/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