Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: vinod.koul@linux.intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/2] DMAEngine: Add DMAEngine driver based on old MSM ADM DMA APIs
Date: Mon, 26 Mar 2012 12:58:38 +0530	[thread overview]
Message-ID: <1332746918.19804.84.camel@vkoul-udesk3> (raw)
In-Reply-To: <CACRpkdbk=Hu6CzXSkkTgNsXGN0tPjfzLYfUpL8D5sxz2=efFxQ@mail.gmail.com>

On Mon, 2012-03-26 at 09:17 +0200, Linus Walleij wrote:
> On Thu, Mar 22, 2012 at 3:23 PM, Ravi Kumar V <kumarrav@codeaurora.org> wrote:
> 
> This stuff:
> 
> > +enum adm_flush_type {
> > +       ADM_FORCED_FLUSH,
> > +       ADM_GRACEFUL_FLUSH,
> > +};
> 
> > +/*
> > + *  Controlling the hardware channel like stopping, flushing.
> > + */
> > +static int msm_dma_chan_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
> > +                                                       unsigned long arg)
> > +{
> > +       enum adm_flush_type cmd_type = arg;
> > +
> > +       if (cmd == DMA_TERMINATE_ALL) {
> > +               switch (cmd_type) {
> > +               case ADM_GRACEFUL_FLUSH:
> > +                               msm_dmov_stop_cmd(chan->chan_id, NULL, 1);
> > +                       break;
> > +               case ADM_FORCED_FLUSH:
> > +                       /*
> > +                        * We treate default as forced flush
> > +                        * so we fall through
> > +                        */
> > +               default:
> > +                               msm_dmov_stop_cmd(chan->chan_id, NULL, 0);
> > +                       break;
> > +               }
> > +       }
> > +       return 0;
> > +}
> 
> This is an interesting way of using the opaque arg. Can you describe
> the different semantics of graceful vs forced flush so we understand
> the usecases for them?
> 
> DMA_TERMINATE_ALL is usually not very graceful.
> 
> DMA_PAUSE might be the semantic you're looking for as the
> graceful path, and then you can do away with this strange
> enum altogether.
I am not a big fan of opaque objects. Btw client should use
dmaengine_terminate_all() only


-- 
~Vinod

      reply	other threads:[~2012-03-26  7:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 14:23 [PATCH v5 2/2] DMAEngine: Add DMAEngine driver based on old MSM ADM DMA APIs Ravi Kumar V
2012-03-26  7:07 ` Vinod Koul
2012-03-26  7:17 ` Linus Walleij
2012-03-26  7:28   ` Vinod Koul [this message]

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=1332746918.19804.84.camel@vkoul-udesk3 \
    --to=vinod.koul@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.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