From patchwork Fri May 27 10:44:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 823482 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4RAiuYK022145 for ; Fri, 27 May 2011 10:45:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758831Ab1E0Ko5 (ORCPT ); Fri, 27 May 2011 06:44:57 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:55176 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758837Ab1E0Ko4 (ORCPT ); Fri, 27 May 2011 06:44:56 -0400 Received: from axis700.grange (dslb-094-221-103-246.pools.arcor-ip.net [94.221.103.246]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0M7o7Y-1PUf9W3nk0-00vNVb; Fri, 27 May 2011 12:44:51 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 957FE189B6D; Fri, 27 May 2011 12:44:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 92656189B6B; Fri, 27 May 2011 12:44:50 +0200 (CEST) Date: Fri, 27 May 2011 12:44:50 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-mmc@vger.kernel.org, Ian Molton , Magnus Damm , Simon Horman Subject: [PATCH 1/3] mmc: tmio: fix for platforms, where CONFIG_ZONE_DMA is not defined In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:bRjwKs74Pbmt2K42ZPho5DxGiDI0LGTDXgPj/IzBi1O P8/VEkdwJQE6hOplYcVVFzQ/19AePcXFpJhB/8usS5kgSJkrT9 nnJSHcX09CQmTjLUIaJcOh1Su9XZzQdNf28fb2nKLI/8+gVCxI 7Q6WtMR1lAIH/8DPmimG2yzZJx2pYV85juewMNMXACBOYYW4OI ThVaM6x6fy676I0LpV460NroCiRgANVTOEPf0/2Xu4= 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, 27 May 2011 10:45:05 +0000 (UTC) On platforms, not defining CONFIG_ZONE_DMA, GFP_DMA cannot be used, switch to using the dma_alloc_coherent() / dma_free_coherent() API. Signed-off-by: Guennadi Liakhovetski --- drivers/mmc/host/tmio_mmc.h | 2 ++ drivers/mmc/host/tmio_mmc_dma.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 8260bc2..f105006 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -20,6 +20,7 @@ #include #include #include +#include /* Definitions for values the CTRL_SDIO_STATUS register can take. */ #define TMIO_SDIO_STAT_IOIRQ 0x0001 @@ -70,6 +71,7 @@ struct tmio_mmc_host { struct tasklet_struct dma_issue; struct scatterlist bounce_sg; u8 *bounce_buf; + dma_addr_t bounce_dma; /* Track lost interrupts */ struct delayed_work delayed_reset_work; diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index 25f1ad6..7fed4c3 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -281,7 +282,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat if (!host->chan_rx) goto ereqrx; - host->bounce_buf = (u8 *)__get_free_page(GFP_KERNEL | GFP_DMA); + host->bounce_buf = dma_alloc_coherent(&host->pdev->dev, + PAGE_SIZE, &host->bounce_dma, GFP_KERNEL); if (!host->bounce_buf) goto ebouncebuf; @@ -314,7 +316,8 @@ void tmio_mmc_release_dma(struct tmio_mmc_host *host) dma_release_channel(chan); } if (host->bounce_buf) { - free_pages((unsigned long)host->bounce_buf, 0); + dma_free_coherent(&host->pdev->dev, PAGE_SIZE, + host->bounce_buf, host->bounce_dma); host->bounce_buf = NULL; } }