linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180
Date: Mon, 24 Jan 2011 16:01:27 +0000	[thread overview]
Message-ID: <20110124160127.GA24104@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTin2fBLsq2YJHjZ=e+gmwWXWezH0t38bzsjiJ+i=@mail.gmail.com>

Linus,

Any response to doing this for MMCI:

+static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl)
+{
+       struct variant_data *variant = host->variant;
+       struct dma_slave_config conf = {
+               .src_addr = host->phybase + MMCIFIFO,
+               .dst_addr = host->phybase + MMCIFIFO,
+               .src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
+               .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
+               .src_maxburst = variant->fifohalfsize >> 2, /* # of words */
+               .dst_maxburst = variant->fifohalfsize >> 2, /* # of words */
+       };
...
+       if (data->flags & MMC_DATA_READ) {
+               conf.direction = DMA_FROM_DEVICE;
+               chan = host->dma_rx_channel;
+       } else {
+               conf.direction = DMA_TO_DEVICE;
+               chan = host->dma_tx_channel;
+       }
...
+       /* shouldn't this be in the DMA engine driver? */
+       if (host->size <= variant->dmasize_threshold) {
+               conf.src_maxburst = 1;
+               conf.dst_maxburst = 1;
+       }
+
+       /* Check for weird stuff in the sg list */
+       /* shouldn't this be in the DMA engine driver? */
+       for_each_sg(data->sg, sg, data->sg_len, i) {
+               dev_vdbg(mmc_dev(host->mmc), "MMCI SGlist %d dir %d: length: %08
+                        i, conf.direction, sg->length);
+               if (sg->offset & 3 || sg->length & 3)
+                       return -EINVAL;
+       }

Can we move that size threshold and scatterlist checks inside the slave
DMA engine driver?

It is entirely possible that different DMA engines have different alignment
requirements and different bursting requirements, so surely it makes sense
for this kind of stuff to be in their drivers rather than in the DMA engine
users?

After all, the DMA engine users don't have much idea about what kind of
DMA engine will be used with themselves with Primecells.

  reply	other threads:[~2011-01-24 16:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06  9:42 [PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180 Linus Walleij
2010-12-19 16:32 ` Russell King - ARM Linux
2010-12-19 19:59   ` Russell King - ARM Linux
2010-12-21 13:54     ` Russell King - ARM Linux
2010-12-21 15:59       ` Russell King - ARM Linux
2010-12-22 21:55         ` Linus Walleij
2011-01-24 16:01           ` Russell King - ARM Linux [this message]
2011-01-24 21:06             ` Linus Walleij
2011-01-24 21:22               ` Russell King - ARM Linux
2011-01-25  8:33                 ` Linus Walleij
2011-01-26  9:24                   ` Russell King - ARM Linux
2011-01-26  9:50                   ` Russell King - ARM Linux
2011-01-25  9:36                 ` Linus Walleij
2011-01-25  9:47                 ` Linus Walleij
2011-01-25 10:23                   ` Russell King - ARM Linux
2011-01-27 13:07                     ` Linus Walleij
2011-02-01 13:30                       ` Russell King - ARM Linux
2011-02-01 14:15                         ` Linus Walleij

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=20110124160127.GA24104@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).