linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: at_xdmac: fix slave configuration issue
Date: Fri, 8 May 2015 14:52:00 +0530	[thread overview]
Message-ID: <20150508092200.GF3521@localhost> (raw)
In-Reply-To: <20150506081342.GO30976@odux.rfo.atmel.com>

On Wed, May 06, 2015 at 10:13:42AM +0200, Ludovic Desroches wrote:
> > ah yes but then you can use the channel for either direction without setting
> > slave_dma_config...
> > 
> 
> I still need dma_slave_config. In my device_config function, I don't
> copy the dma_slave_config but I take information from it to compute a
> dev2mem and mem2dev configuration. Then I will select the right one in
> the prep function. I think it's quite close from that you want.
since you do not know the direction here, you dont know how to compute
dev2mem or mem2dev configurations

> 
> In the device_config, I convert the maxburst value to a comprehensive
> one for my controller. If it is not a supported one then I'll return an
> error?
thats fine as long as direction is not used, implicitly as well

> Are you okay with this procedure? If not, I have totally misunderstood
> what you want...
> 
> My concern is that a device can fill only what it needs in the
> dma_slave_config structure. When doing the configuration, the controller
> doesn't care about the direction as you asked but if a maxburst
> configuration is not set, I will have a zero value which is not a valid
> one. I will return an error but is not...
Yes that is why many drivers will save configuration. Checking values
for sanity makes sense. No point in accepting config for 64 max burst if
device support upto 32!

Then you use direction is prepare_ api to compute parameters and if
you detect further errors in configuration for said txn then you are valid
to return error. Again if client has sent one direction parameters and in
prepare you will not return error as direction will be apt so current issue
will be fixed as well

-- 
~Vinod

      reply	other threads:[~2015-05-08  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 15:04 [PATCH] dmaengine: at_xdmac: fix slave configuration issue Ludovic Desroches
2015-04-27  3:33 ` Vinod Koul
2015-04-27  8:33   ` Ludovic Desroches
2015-05-04  8:25     ` Vinod Koul
2015-05-04  9:12       ` Ludovic Desroches
2015-05-04 10:36         ` Vinod Koul
2015-05-04 14:58           ` Ludovic Desroches
2015-05-06  3:33             ` Vinod Koul
2015-05-06  8:13               ` Ludovic Desroches
2015-05-08  9:22                 ` 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=20150508092200.GF3521@localhost \
    --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 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).