From: "Madhusudhan" <madhu.cr@ti.com>
To: 'David Vrabel' <david.vrabel@csr.com>, linux-mmc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Subject: RE: [PATCH 1/3] mmc: omap_hsmmc: use packet sync'd DMA
Date: Wed, 17 Feb 2010 11:21:14 -0600 [thread overview]
Message-ID: <003601caaff5$9bf1e4d0$544ff780@am.dhcp.ti.com> (raw)
In-Reply-To: <846fbf1a68cde5fd2d7c7ab084ace239c8de6867.1265801967.git.david.vrabel@csr.com>
> -----Original Message-----
> From: David Vrabel [mailto:david.vrabel@csr.com]
> Sent: Wednesday, February 10, 2010 5:52 AM
> To: linux-mmc@vger.kernel.org
> Cc: David Vrabel; linux-omap@vger.kernel.org; madhu.cr@ti.com
> Subject: [PATCH 1/3] mmc: omap_hsmmc: use packet sync'd DMA
>
> Use packet sync'd DMA in the omap_hsmmc driver to avoid the
> restriction that transfers must be a multiple of the block size. This
> is required for byte-mode transfers to SDIO cards.
>
What is the typical scenario here? Is it IO_RW_EXTENDED with block_mode
turned off?
> Signed-off-by: David Vrabel <david.vrabel@csr.com>
> ---
> drivers/mmc/host/omap_hsmmc.c | 17 +++++------------
> 1 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 4b23225..e7142a2 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -114,6 +114,7 @@
>
> #define MMC_TIMEOUT_MS 20
> #define OMAP_MMC_MASTER_CLOCK 96000000
> +#define OMAP_HSMMC_FIFO_WORDS (512/4)
> #define DRIVER_NAME "mmci-omap-hs"
>
> /* Timeouts for entering power saving states on inactivity, msec */
> @@ -887,12 +888,12 @@ static void omap_hsmmc_config_dma_params(struct
> omap_hsmmc_host *host,
> dma_ch = host->dma_ch;
> if (data->flags & MMC_DATA_WRITE) {
> omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT,
> - (host->mapbase + OMAP_HSMMC_DATA), 0, 0);
> + (host->mapbase + OMAP_HSMMC_DATA), 0,
> OMAP_HSMMC_FIFO_WORDS);
> omap_set_dma_src_params(dma_ch, 0, OMAP_DMA_AMODE_POST_INC,
> sg_dma_address(sgl), 0, 0);
> } else {
> omap_set_dma_src_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT,
> - (host->mapbase + OMAP_HSMMC_DATA), 0, 0);
> + (host->mapbase + OMAP_HSMMC_DATA), 0,
> OMAP_HSMMC_FIFO_WORDS);
> omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_POST_INC,
> sg_dma_address(sgl), 0, 0);
> }
> @@ -901,7 +902,7 @@ static void omap_hsmmc_config_dma_params(struct
> omap_hsmmc_host *host,
> nblk = sg_dma_len(sgl) / blksz;
>
> omap_set_dma_transfer_params(dma_ch, OMAP_DMA_DATA_TYPE_S32,
> - blksz / 4, nblk, OMAP_DMA_SYNC_FRAME,
> + blksz / 4, nblk, OMAP_DMA_SYNC_PACKET,
> omap_hsmmc_get_dma_sync_dev(host, data),
> !(data->flags & MMC_DATA_WRITE));
>
How does this configuration help? Isn't the PACKET again a multiple of
blksz?
> @@ -944,17 +945,9 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status,
> void *data)
> static int omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host,
> struct mmc_request *req)
> {
> - int dma_ch = 0, ret = 0, err = 1, i;
> + int dma_ch = 0, ret = 0, err = 1;
> struct mmc_data *data = req->data;
>
> - /* Sanity check: all the SG entries must be aligned by block size.
> */
> - for (i = 0; i < data->sg_len; i++) {
> - struct scatterlist *sgl;
> -
> - sgl = data->sg + i;
> - if (sgl->length % data->blksz)
> - return -EINVAL;
> - }
> if ((data->blksz % 4) != 0)
> /* REVISIT: The MMC buffer increments only when MSB is
> written.
> * Return error for blksz which is non multiple of four.
> --
> 1.6.3.3
next prev parent reply other threads:[~2010-02-17 17:21 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-10 11:51 [PATCH 0/3] mmc: omap_hsmmc: support SDIO cards David Vrabel
2010-02-10 11:51 ` [PATCH 1/3] mmc: omap_hsmmc: use packet sync'd DMA David Vrabel
2010-02-17 17:21 ` Madhusudhan [this message]
2010-02-17 17:47 ` David Vrabel
2010-02-10 11:51 ` [PATCH 2/3] mmc: omap_hsmmc: don't turn SDIO cards off when idle David Vrabel
2010-02-10 11:52 ` [PATCH 3/3] mmc: omap_hsmmc: enable SDIO card interrupts David Vrabel
2010-02-17 18:09 ` David Vrabel
2010-02-17 21:34 ` Cousson, Benoit
2010-02-17 18:45 ` Madhusudhan
2010-02-17 19:39 ` David Vrabel
2010-02-17 20:49 ` Paul Walmsley
2010-02-18 13:20 ` David Vrabel
2010-02-18 17:43 ` Paul Walmsley
2010-02-18 18:39 ` Madhusudhan
2010-02-18 19:27 ` Nicolas Pitre
2010-02-18 20:20 ` Madhusudhan
2010-02-18 20:21 ` Paul Walmsley
2010-02-18 22:16 ` Steve Sakoman
2010-02-18 23:45 ` Nicolas Pitre
2010-03-02 22:08 ` Madhusudhan
2010-03-02 23:29 ` Steve Sakoman
2010-02-19 21:47 ` Madhusudhan
2010-02-18 0:26 ` Madhusudhan
2010-02-18 12:15 ` David Vrabel
2010-02-18 17:03 ` Madhusudhan
2010-02-19 21:05 ` Madhusudhan
2010-02-20 1:37 ` Madhusudhan
2010-02-22 14:28 ` David Vrabel
2010-02-11 8:29 ` [PATCH 0/3] mmc: omap_hsmmc: support SDIO cards Mike Rapoport
2010-02-11 11:10 ` David Vrabel
2010-02-11 11:42 ` Mike Rapoport
2010-02-11 12:12 ` David Vrabel
2010-02-11 12:31 ` Mike Rapoport
2010-02-18 6:57 ` Mike Rapoport
2010-02-18 16:53 ` Madhusudhan
2010-02-21 6:33 ` Mike Rapoport
2010-02-18 7:02 ` Mike Rapoport
2010-02-18 18:06 ` David Vrabel
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='003601caaff5$9bf1e4d0$544ff780@am.dhcp.ti.com' \
--to=madhu.cr@ti.com \
--cc=david.vrabel@csr.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.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