From patchwork Thu Feb 18 06:57:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 80209 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1I6x9qr019285 for ; Thu, 18 Feb 2010 06:59:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752010Ab0BRG7F (ORCPT ); Thu, 18 Feb 2010 01:59:05 -0500 Received: from compulab.co.il ([67.18.134.219]:55822 "EHLO compulab.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351Ab0BRG7C (ORCPT ); Thu, 18 Feb 2010 01:59:02 -0500 Received: from mail.linux-boards.com ([192.114.83.142] helo=zimbra-mta.compulab.co.il) by compulab.site5.com with esmtp (Exim 4.69) (envelope-from ) id 1Ni0Lh-0006sK-OC; Thu, 18 Feb 2010 00:58:58 -0600 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id DE7F19A034F; Thu, 18 Feb 2010 08:58:56 +0200 (IST) X-Virus-Scanned: amavisd-new at compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fjsWIg1N75QU; Thu, 18 Feb 2010 08:58:56 +0200 (IST) Received: from [10.1.1.77] (droid.compulab.local [10.1.1.77]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 83BA99A0343; Thu, 18 Feb 2010 08:58:56 +0200 (IST) Message-ID: <4B7CE4EC.5090403@compulab.co.il> Date: Thu, 18 Feb 2010 08:57:48 +0200 From: Mike Rapoport User-Agent: Thunderbird 2.0.0.23 (X11/20100106) MIME-Version: 1.0 To: David Vrabel CC: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, madhu.cr@ti.com, Mike Rapoport Subject: Re: [PATCH 0/3] mmc: omap_hsmmc: support SDIO cards References: <4B73BFD3.8090106@compulab.co.il> <4B73E59F.3020400@csr.com> <4B73ED3C.9010107@compulab.co.il> <4B73F418.6070804@csr.com> <4B73F8B0.100@compulab.co.il> In-Reply-To: <4B73F8B0.100@compulab.co.il> X-ACL-Warn: { X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - compulab.site5.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Source: X-Source-Args: X-Source-Dir: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Feb 2010 06:59:09 +0000 (UTC) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4b23225..5408bcb 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 */ @@ -884,24 +885,24 @@ static void omap_hsmmc_config_dma_params(struct omap_hsmmc_host *host, { int blksz, nblk, dma_ch; + blksz = host->data->blksz; + nblk = sg_dma_len(sgl) / blksz; + 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, blksz / 4); 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, blksz / 4); omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_POST_INC, sg_dma_address(sgl), 0, 0); } - blksz = host->data->blksz; - 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)); @@ -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.