From patchwork Fri Mar 4 10:26:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 311 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:39 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs9868qah; Fri, 4 Mar 2011 02:26:02 -0800 (PST) Received: by 10.52.91.210 with SMTP id cg18mr667143vdb.19.1299234362732; Fri, 04 Mar 2011 02:26:02 -0800 (PST) Received: from mail-qw0-f50.google.com (mail-qw0-f50.google.com [209.85.216.50]) by mx.google.com with ESMTPS id h30si2943960vcr.100.2011.03.04.02.26.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 02:26:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.216.50 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.216.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.50 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) smtp.mail=linus.walleij@linaro.org Received: by qwk3 with SMTP id 3so1841603qwk.37 for ; Fri, 04 Mar 2011 02:26:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.116.129 with SMTP id m1mr329194qaq.134.1299234361307; Fri, 04 Mar 2011 02:26:01 -0800 (PST) Received: by 10.224.28.201 with HTTP; Fri, 4 Mar 2011 02:26:01 -0800 (PST) In-Reply-To: <1297350569-1806-1-git-send-email-linus.walleij@linaro.org> References: <1297350569-1806-1-git-send-email-linus.walleij@linaro.org> Date: Fri, 4 Mar 2011 11:26:01 +0100 Message-ID: Subject: Fwd: [PATCH 04/11] sh_mmcif: map DMA buffers on the DMA engine device From: Linus Walleij To: Patch Tracking ---------- Forwarded message ---------- From: Linus Walleij Date: Thu, Feb 10, 2011 at 4:09 PM Subject: [PATCH 04/11] sh_mmcif: map DMA buffers on the DMA engine device To: linux-mmc@vger.kernel.org, Chris Ball Cc: Dan Williams , Paul Mundt , 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 ---  drivers/mmc/host/sh_mmcif.c |   12 ++++++++----  1 files changed, 8 insertions(+), 4 deletions(-)                host->dma_sglen = ret;                desc = chan->device->device_prep_slave_sg(chan, sg, ret, @@ -263,7 +266,8 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)        dma_cookie_t cookie = -EINVAL;        int ret; -       ret = dma_map_sg(&host->pd->dev, sg, host->data->sg_len, DMA_TO_DEVICE); +       ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len, +                        DMA_TO_DEVICE);        if (ret > 0) {                host->dma_sglen = ret;                desc = chan->device->device_prep_slave_sg(chan, sg, ret, -- 1.7.4 diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 12884c2..8e4aba9 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -194,10 +194,12 @@ static void mmcif_dma_complete(void *arg)                return;        if (host->data->flags & MMC_DATA_READ) -               dma_unmap_sg(&host->pd->dev, host->data->sg, host->dma_sglen, +               dma_unmap_sg(host->chan_rx->device->dev, +                            host->data->sg, host->dma_sglen,                             DMA_FROM_DEVICE);        else -               dma_unmap_sg(&host->pd->dev, host->data->sg, host->dma_sglen, +               dma_unmap_sg(host->chan_tx->device->dev, +                            host->data->sg, host->dma_sglen,                             DMA_TO_DEVICE);        complete(&host->dma_complete); @@ -211,7 +213,8 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)        dma_cookie_t cookie = -EINVAL;        int ret; -       ret = dma_map_sg(&host->pd->dev, sg, host->data->sg_len, DMA_FROM_DEVICE); +       ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len, +                        DMA_FROM_DEVICE);        if (ret > 0) {