From patchwork Mon Dec 23 13:22:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 3396621 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A878D9F169 for ; Mon, 23 Dec 2013 13:22:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F6AF20667 for ; Mon, 23 Dec 2013 13:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 355CF206A6 for ; Mon, 23 Dec 2013 13:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757327Ab3LWNWn (ORCPT ); Mon, 23 Dec 2013 08:22:43 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:40520 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756990Ab3LWNWn (ORCPT ); Mon, 23 Dec 2013 08:22:43 -0500 Received: by mail-pa0-f46.google.com with SMTP id kp14so3407295pab.19 for ; Mon, 23 Dec 2013 05:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BsYlF9LlNkGnPGVR1x8NrvLld5MGoO4vGduDtKT8EK8=; b=PUxUoaqqfaarjJMsacio6uZ3tv9PSO8KI1bfGiJS6HPj/hgjqFzaix6znxKnEj0emB LXihKbYdQpJjIQdTGBmZ2vc1vFreqtLXBzoTwQ4Z0kNz0aFHIIVHK5E2T6HpRZkHZrnV zobcwywE00OH7kdSmFTjWIfpI+uDG2unQexoVBm1feHAV7qkX/5EGbf6l+UcJ7zsHmwo T9RqY/5g0j5i9hUTefQSOXJT3nB+p8x+UD4XJ+tNYMRdO9fGN8bgReNfk6lxnyMZMThx reOifZxT6XFoAinu5fy10E4TiMuG63ADZpe22OU+bPvOC0cV0Bd+y0rjOl082QLj1XuR dKhw== X-Received: by 10.66.164.70 with SMTP id yo6mr25996940pab.85.1387804962647; Mon, 23 Dec 2013 05:22:42 -0800 (PST) Received: from localhost.localdomain ([101.245.121.84]) by mx.google.com with ESMTPSA id vf7sm34409028pbc.5.2013.12.23.05.22.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 05:22:42 -0800 (PST) From: Barry Song <21cnbao@gmail.com> To: cjb@laptop.org Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, workgroup.linux@csr.com, Bin Shi , Barry Song Subject: [PATCH 2/2] mmc: sirf: enable combined dma buffer Date: Mon, 23 Dec 2013 21:22:04 +0800 Message-Id: <1387804924-3372-2-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1387804924-3372-1-git-send-email-21cnbao@gmail.com> References: <1387804924-3372-1-git-send-email-21cnbao@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bin Shi To take advantage of combined dma buffer, enable SDHCI_QUIRK2_SG_LIST_COMBINED_DMA_BUFFER to lift read/write performance. Signed-off-by: Bin Shi Signed-off-by: Barry Song --- drivers/mmc/host/sdhci-sirf.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c index 696122c..2933ae4 100644 --- a/drivers/mmc/host/sdhci-sirf.c +++ b/drivers/mmc/host/sdhci-sirf.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,7 @@ static struct sdhci_pltfm_data sdhci_sirf_pdata = { SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | SDHCI_QUIRK_INVERTED_WRITE_PROTECT | SDHCI_QUIRK_DELAY_AFTER_POWER, + .quirks2 = SDHCI_QUIRK2_SG_LIST_COMBINED_DMA_BUFFER, }; static int sdhci_sirf_probe(struct platform_device *pdev) @@ -75,6 +77,11 @@ static int sdhci_sirf_probe(struct platform_device *pdev) if (ret) goto err_clk_prepare; + host->combined_dma_buffer = dma_alloc_coherent(&pdev->dev, + SZ_1M, &host->combined_dma_addr, GFP_KERNEL | GFP_DMA); + if (!host->combined_dma_buffer) + goto err_request_dma; + ret = sdhci_add_host(host); if (ret) goto err_sdhci_add; @@ -97,6 +104,9 @@ static int sdhci_sirf_probe(struct platform_device *pdev) err_request_cd: sdhci_remove_host(host, 0); err_sdhci_add: + dma_free_coherent(&pdev->dev, SZ_1M, host->combined_dma_buffer, + host->combined_dma_addr); +err_request_dma: clk_disable_unprepare(priv->clk); err_clk_prepare: sdhci_pltfm_free(pdev); @@ -114,6 +124,9 @@ static int sdhci_sirf_remove(struct platform_device *pdev) if (gpio_is_valid(priv->gpio_cd)) mmc_gpio_free_cd(host->mmc); + dma_free_coherent(&pdev->dev, SZ_1M, host->combined_dma_buffer, + host->combined_dma_addr); + clk_disable_unprepare(priv->clk); return 0; }