From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>,
Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 01/11] atmel-mci: map DMA sglist on the DMA engine
Date: Thu, 10 Feb 2011 16:17:44 +0100 [thread overview]
Message-ID: <4D540198.6000504@atmel.com> (raw)
In-Reply-To: <1297350486-1004-1-git-send-email-linus.walleij@linaro.org>
Le 10/02/2011 16:08, Linus Walleij :
> As established for the MMCI, it is proper to map the DMA buffers
> on the DMA engine which is the one actually performing the DMA.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/mmc/host/atmel-mci.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index ad2a7a0..045bdbb 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -578,7 +578,8 @@ static void atmci_dma_cleanup(struct atmel_mci *host)
> struct mmc_data *data = host->data;
>
> if (data)
> - dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len,
> + dma_unmap_sg(host->dma.chan->device->dev,
> + data->sg, data->sg_len,
> ((data->flags & MMC_DATA_WRITE)
> ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
> }
> @@ -684,7 +685,8 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
> else
> direction = DMA_TO_DEVICE;
>
> - sglen = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, direction);
> + sglen = dma_map_sg(chan->device->dev, data->sg,
> + data->sg_len, direction);
> if (sglen != data->sg_len)
> goto unmap_exit;
> desc = chan->device->device_prep_slave_sg(chan,
> @@ -699,7 +701,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
>
> return 0;
> unmap_exit:
> - dma_unmap_sg(&host->pdev->dev, data->sg, sglen, direction);
> + dma_unmap_sg(chan->device->dev, data->sg, sglen, direction);
> return -ENOMEM;
> }
>
--
Nicolas Ferre
prev parent reply other threads:[~2011-02-10 15:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-10 15:08 [PATCH 01/11] atmel-mci: map DMA sglist on the DMA engine Linus Walleij
2011-02-10 15:17 ` Nicolas Ferre [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=4D540198.6000504@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=cjb@laptop.org \
--cc=dan.j.williams@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-mmc@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