From patchwork Fri Jun 17 18:14:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 892182 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5HIF8I8011890 for ; Fri, 17 Jun 2011 18:15:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932066Ab1FQSPH (ORCPT ); Fri, 17 Jun 2011 14:15:07 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:47816 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932104Ab1FQSPG (ORCPT ); Fri, 17 Jun 2011 14:15:06 -0400 Received: by bwz15 with SMTP id 15so955309bwz.19 for ; Fri, 17 Jun 2011 11:15:05 -0700 (PDT) Received: by 10.204.101.73 with SMTP id b9mr1933789bko.85.1308334504946; Fri, 17 Jun 2011 11:15:04 -0700 (PDT) Received: from localhost.localdomain (c-3c7b71d5.029-82-6c756e10.cust.bredbandsbolaget.se [213.113.123.60]) by mx.google.com with ESMTPS id v6sm2206057bkf.23.2011.06.17.11.15.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Jun 2011 11:15:03 -0700 (PDT) From: Per Forlin To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, Venkatraman S Cc: Chris Ball , Per Forlin Subject: [PATCH RESEND] omap_hsmmc: use original sg_len for dma_unmap_sg Date: Fri, 17 Jun 2011 20:14:21 +0200 Message-Id: <1308334461-3869-1-git-send-email-per.forlin@linaro.org> X-Mailer: git-send-email 1.7.4.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Jun 2011 18:15:08 +0000 (UTC) Don't use the returned sg_len from dma_map_sg() as inparameter to dma_unmap_sg(). Use the original sg_len for both dma_map_sg and dma_unmap_sg according to the documentation in DMA-API.txt. Signed-off-by: Per Forlin Reviewed-by: Venkatraman S --- drivers/mmc/host/omap_hsmmc.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 259ece0..ad3731a 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -959,7 +959,8 @@ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno) spin_unlock(&host->irq_lock); if (host->use_dma && dma_ch != -1) { - dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len, + dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, + host->data->sg_len, omap_hsmmc_get_dma_dir(host, host->data)); omap_free_dma(dma_ch); } @@ -1343,7 +1344,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data) return; } - dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len, + dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, omap_hsmmc_get_dma_dir(host, data)); req_in_progress = host->req_in_progress;