linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jassi Brar <jassisinghbrar@gmail.com>
To: Inderpal Singh <inderpal.singh@linaro.org>
Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	boojin.kim@samsung.com, vinod.koul@intel.com, patches@linaro.org,
	kgene.kim@samsung.com
Subject: Re: [PATCH 3/3] DMA: PL330: Balance module remove function with probe
Date: Tue, 25 Sep 2012 18:47:09 +0530	[thread overview]
Message-ID: <CABb+yY3TcVr=0Po0N7TLCkQ9TmMJuvQhKJj3aQ1bP9+68T+Ogw@mail.gmail.com> (raw)
In-Reply-To: <1348563456-30569-4-git-send-email-inderpal.singh@linaro.org>

On Tue, Sep 25, 2012 at 2:27 PM, Inderpal Singh
<inderpal.singh@linaro.org> wrote:
> Since peripheral channel resources are not being allocated at probe,
> no need to flush the channels and free the resources in remove function.
>
> Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
> ---
>  drivers/dma/pl330.c |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 04d83e6..6f06080 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -3012,16 +3012,10 @@ static int __devexit pl330_remove(struct amba_device *adev)
>
>         /* Idle the DMAC */
>         list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
> -                       chan.device_node) {
> -
> +                       chan.device_node)
>                 /* Remove the channel */
>                 list_del(&pch->chan.device_node);
>
> -               /* Flush the channel */
> -               pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0);
> -               pl330_free_chan_resources(&pch->chan);
> -       }
> -
>         while (!list_empty(&pdmac->desc_pool)) {
>                 desc = list_entry(pdmac->desc_pool.next,
>                                 struct dma_pl330_desc, node);

I am not sure about this patch. The DMA_TERMINATE_ALL is only called
by the client and if the pl330 module is forced unloaded while some
client is queued, we have to manually do DMA_TERMINATE_ALL.
A better option could be to simply fail pl330_remove if some client is
queued on the DMAC.

-jassi

  reply	other threads:[~2012-09-25 13:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25  8:57 [PATCH 0/3] DMA: PL330: Fix mem leaks and balance probe/remove Inderpal Singh
2012-09-25  8:57 ` [PATCH 1/3] DMA: PL330: Free memory allocated for peripheral channels Inderpal Singh
2012-09-25 12:47   ` Jassi Brar
2012-09-25 15:23     ` Inderpal Singh
2012-09-25  8:57 ` [PATCH 2/3] DMA: PL330: Change allocation method to properly free DMA descriptors Inderpal Singh
2012-09-25 13:09   ` Jassi Brar
2012-09-25 15:26     ` Inderpal Singh
2012-09-25  8:57 ` [PATCH 3/3] DMA: PL330: Balance module remove function with probe Inderpal Singh
2012-09-25 13:17   ` Jassi Brar [this message]
2012-09-26  6:41     ` Inderpal Singh
2012-09-26  9:32       ` Jassi Brar
2012-09-26 10:55         ` Inderpal Singh
2012-09-26 16:49           ` Jassi Brar
2012-09-27  4:13             ` Inderpal Singh
2012-09-27  5:05               ` Jassi Brar
2012-09-27  5:30                 ` Inderpal Singh
2012-09-27  6:03                   ` Jassi Brar
2012-09-27  9:48       ` Vinod Koul
2012-09-27 15:41         ` Inderpal Singh
2012-09-27 16:06           ` Jassi Brar
2012-09-28  4:33             ` Inderpal Singh
2012-09-28 10:58               ` Jassi Brar
2012-10-01  9:59                 ` Inderpal Singh

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='CABb+yY3TcVr=0Po0N7TLCkQ9TmMJuvQhKJj3aQ1bP9+68T+Ogw@mail.gmail.com' \
    --to=jassisinghbrar@gmail.com \
    --cc=boojin.kim@samsung.com \
    --cc=inderpal.singh@linaro.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=vinod.koul@intel.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;
as well as URLs for NNTP newsgroup(s).