devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: M'boumba Cedric Madianga
	<cedric.madianga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Maxime Coquelin
	<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 2/4] dmaengine: Add STM32 DMA driver
Date: Wed, 14 Oct 2015 14:29:16 +0100	[thread overview]
Message-ID: <561E58AC.80207@linaro.org> (raw)
In-Reply-To: <CAOAejn2pcFSn3Hf=j6zgg6Ui6GjJZrtRch6ywByHaVLsTLMk6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 14/10/15 14:17, M'boumba Cedric Madianga wrote:
> Hi Daniel,
>
>>>> +
>>>> +static int stm32_dma_remove(struct platform_device *pdev)
>>>> +{
>>>> +       struct stm32_dma_device *dmadev = platform_get_drvdata(pdev);
>>>> +
>>>> +       of_dma_controller_free(pdev->dev.of_node);
>>>> +
>>>> +       dma_async_device_unregister(&dmadev->ddev);
>>>> +
>>>> +       clk_disable_unprepare(dmadev->clk);
>>>
>>>
>>> What is the purpose of disabling/unpreparing the clock here?
>>> stm32_dma_alloc_chan_resources() and stm32_dma_free_chan_resources() should
>>> pair up and the clock should already be stopped.
>
> stm32_dma_remove() could be called during an on-going transfer during
> module unload.
> So in that case, it seems that disabling/unpreparing the clock is needed.

Really?

I think we need to be sure any on-going transfers are stopped.

There are multiple reasons for this, not least the risk of executing a 
callback that has been freed, but the one related to my point is that a 
single clk_disable_unprepare() will remain broken because if you don't 
know that the transfers have stopped then you don't know how many 
on-going transfers there are.


Daniel.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-10-14 13:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13 14:05 [PATCH v2 0/4] Add support for STM32 DMA M'boumba Cedric Madianga
2015-10-13 14:05 ` [PATCH v2 1/4] dt-bindings: Document the STM32 DMA bindings M'boumba Cedric Madianga
2015-10-14  8:54   ` M'boumba Cedric Madianga
2015-10-13 14:05 ` [PATCH v2 2/4] dmaengine: Add STM32 DMA driver M'boumba Cedric Madianga
     [not found]   ` <1444745127-1105-3-git-send-email-cedric.madianga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-13 14:34     ` Daniel Thompson
     [not found]       ` <561D1689.90703-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14  7:54         ` M'boumba Cedric Madianga
2015-10-14  8:52           ` Daniel Thompson
     [not found]             ` <561E17EA.6000900-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14  8:57               ` M'boumba Cedric Madianga
2015-10-14 13:17           ` M'boumba Cedric Madianga
     [not found]             ` <CAOAejn2pcFSn3Hf=j6zgg6Ui6GjJZrtRch6ywByHaVLsTLMk6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-14 13:29               ` Daniel Thompson [this message]
2015-10-14 13:41                 ` M'boumba Cedric Madianga
2015-10-14 14:24                   ` Daniel Thompson
     [not found]                     ` <561E658D.1070900-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14 15:26                       ` M'boumba Cedric Madianga
2015-10-14 15:28                         ` Daniel Thompson
     [not found]                           ` <561E7497.1050105-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14 15:41                             ` M'boumba Cedric Madianga
     [not found]                               ` <CAOAejn0chZD5mgi8WrW3ow3APUHTJOYP4=G2jCZ_Po4qe9eACw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-15  4:07                                 ` Vinod Koul
2015-10-14 11:16     ` Vinod Koul
2015-10-14 13:07       ` M'boumba Cedric Madianga
2015-10-14 14:14         ` Vinod Koul
2015-10-13 14:05 ` [PATCH v2 3/4] ARM: dts: Add STM32 DMA support for STM32F429 MCU M'boumba Cedric Madianga
2015-10-13 14:05 ` [PATCH v2 4/4] ARM: configs: Add STM32 DMA support in STM32 defconfig M'boumba Cedric Madianga

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=561E58AC.80207@linaro.org \
    --to=daniel.thompson-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=cedric.madianga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).