All of lore.kernel.org
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/3] dma: Add Freescale eDMA engine driver support
Date: Mon, 2 Sep 2013 16:42:00 +0530	[thread overview]
Message-ID: <20130902111200.GP7376@intel.com> (raw)
In-Reply-To: <B56CDBE15CE27145A4B77D2D24263E8520F101@039-SN1MPN1-004.039d.mgd.msft.net>

On Mon, Sep 02, 2013 at 07:32:53AM +0000, Lu Jingchang-B35083 wrote:
> > > > > > > +	chan->private = fn_param;
> > > > > > why do you need to use chan->private?
> > > > > [Lu Jingchang]
> > > > > The private used here is to store the slot_id information, which
> > must
> > > > be used
> > > > > by the DMAMUX in alloc_chan_resources function. Thanks.
> > > > Why dont you pass this in struct dma_slave_config memeber slave_id
> > for
> > > > this.
> > > [Lu Jingchang-b35083]
> > > I will drop this private and setup the slave_id directly in the filter
> > function.
> > why in filter? before calling prepare function you can set the slave
> > config
> How about change the filter_fn to follow:
> static bool fsl_edma_filter_fn(struct dma_chan *chan, void *fn_param)
> {
>         struct fsl_edma_filter_param *fparam = fn_param;
>         struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);
>         unsigned char val;
> 
>         if (fsl_chan->edmamux->mux_id != fparam->mux_id)
>                 return false;
> 
>         val = EDMAMUX_CHCFG_ENBL | EDMAMUX_CHCFG_SOURCE(fparam->slot_id);
>         fsl_edmamux_config_chan(fsl_chan, val);
>         return true;
> }
> In fact the slot_id isn't need elsewhere, and if the filter return true, 
> This channel should be to this request. So no need to save the slave id, Right?
something like

static bool fsl_edma_filter_fn(struct dma_chan *chan, void *fn_param)
{
	struct fsl_edma_filter_param *fparam = fn_param;
	struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);

	if (fsl_chan->edmamux->mux_id != fparam->mux_id)
		return false;
	return true;
}

in thedriver which calls this:

before prep:

	config->slave_id = val;

	dma_set_slave_config(chan, slave);

~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Lu Jingchang-B35083 <B35083@freescale.com>
Cc: "shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v4 3/3] dma: Add Freescale eDMA engine driver support
Date: Mon, 2 Sep 2013 16:42:00 +0530	[thread overview]
Message-ID: <20130902111200.GP7376@intel.com> (raw)
In-Reply-To: <B56CDBE15CE27145A4B77D2D24263E8520F101@039-SN1MPN1-004.039d.mgd.msft.net>

On Mon, Sep 02, 2013 at 07:32:53AM +0000, Lu Jingchang-B35083 wrote:
> > > > > > > +	chan->private = fn_param;
> > > > > > why do you need to use chan->private?
> > > > > [Lu Jingchang]
> > > > > The private used here is to store the slot_id information, which
> > must
> > > > be used
> > > > > by the DMAMUX in alloc_chan_resources function. Thanks.
> > > > Why dont you pass this in struct dma_slave_config memeber slave_id
> > for
> > > > this.
> > > [Lu Jingchang-b35083]
> > > I will drop this private and setup the slave_id directly in the filter
> > function.
> > why in filter? before calling prepare function you can set the slave
> > config
> How about change the filter_fn to follow:
> static bool fsl_edma_filter_fn(struct dma_chan *chan, void *fn_param)
> {
>         struct fsl_edma_filter_param *fparam = fn_param;
>         struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);
>         unsigned char val;
> 
>         if (fsl_chan->edmamux->mux_id != fparam->mux_id)
>                 return false;
> 
>         val = EDMAMUX_CHCFG_ENBL | EDMAMUX_CHCFG_SOURCE(fparam->slot_id);
>         fsl_edmamux_config_chan(fsl_chan, val);
>         return true;
> }
> In fact the slot_id isn't need elsewhere, and if the filter return true, 
> This channel should be to this request. So no need to save the slave id, Right?
something like

static bool fsl_edma_filter_fn(struct dma_chan *chan, void *fn_param)
{
	struct fsl_edma_filter_param *fparam = fn_param;
	struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);

	if (fsl_chan->edmamux->mux_id != fparam->mux_id)
		return false;
	return true;
}

in thedriver which calls this:

before prep:

	config->slave_id = val;

	dma_set_slave_config(chan, slave);

~Vinod

  reply	other threads:[~2013-09-02 11:12 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16  6:07 [PATCH v4 3/3] dma: Add Freescale eDMA engine driver support Jingchang Lu
2013-08-16  6:07 ` Jingchang Lu
2013-08-28  6:57 ` Lu Jingchang-B35083
2013-08-28  6:57   ` Lu Jingchang-B35083
2013-08-28  8:17 ` Vinod Koul
2013-08-28  8:17   ` Vinod Koul
2013-08-29  3:32   ` Lu Jingchang-B35083
2013-08-29  3:32     ` Lu Jingchang-B35083
2013-08-29  3:32     ` Lu Jingchang-B35083
2013-09-02  4:50     ` Vinod Koul
2013-09-02  4:50       ` Vinod Koul
2013-09-02  7:10       ` Lu Jingchang-B35083
2013-09-02  7:10         ` Lu Jingchang-B35083
2013-09-02  7:10         ` Lu Jingchang-B35083
2013-09-02  6:37         ` Vinod Koul
2013-09-02  6:37           ` Vinod Koul
2013-09-02  7:32           ` Lu Jingchang-B35083
2013-09-02  7:32             ` Lu Jingchang-B35083
2013-09-02  7:32             ` Lu Jingchang-B35083
2013-09-02 11:12             ` Vinod Koul [this message]
2013-09-02 11:12               ` Vinod Koul
2013-09-03  5:43               ` Lu Jingchang-B35083
2013-09-03  5:43                 ` Lu Jingchang-B35083
2013-09-03  5:43                 ` Lu Jingchang-B35083
2013-09-03 11:31                 ` Vinod Koul
2013-09-03 11:31                   ` Vinod Koul
2013-09-04  2:02                   ` Lu Jingchang-B35083
2013-09-04  2:02                     ` Lu Jingchang-B35083
2013-09-04  2:02                     ` Lu Jingchang-B35083
2013-09-05  8:18                   ` Lu Jingchang-B35083
2013-09-05  8:18                     ` Lu Jingchang-B35083
2013-09-05  8:18                     ` Lu Jingchang-B35083

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=20130902111200.GP7376@intel.com \
    --to=vinod.koul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.