From patchwork Fri Nov 24 16:24:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119607 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2443549qgn; Fri, 24 Nov 2017 08:27:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMbm09zxknnRpMLKcOSiUJHsBFVeKGRQy9u6dvK56wqh8gR2JPDapBXhjuY5bBj5eaEdww6X X-Received: by 10.159.194.18 with SMTP id x18mr21934884pln.412.1511540841904; Fri, 24 Nov 2017 08:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540841; cv=none; d=google.com; s=arc-20160816; b=yMvOIPe5r5Tr/sRO/cnoziVpOR1y7qmq9+Hg0gCbwPXonN9A1zqLOCbW8PmYkiEXsd lb/LJTwkg07K5tWcEp+m0VhllGC3BtxjOlVIlx7RFmUsyHAFLU4UmpzaVJTqBU63EX1g TICoJRVVGF5tVb3E+yVd0fb/QlPnejZm02hGGU2gjhfEJCCWPOeq6Mj4PjT1l240as/t karop6TkshNqF3CDgoYT6/M9KsYJDWJ7Vw8L8v8F+pzEQIyWkTchq2SKroxnwayQlfpy jRlce34wJQZ27UMAbAIH56bsQJujOPpl3yKGVBuZ9u8sx7EJO5ZAqrgkZwTuP4mjQaoD 1kDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=hv2hJ2KtBq3XC79cSLR3gHYcopTEpInBfLSR+MP1Qks=; b=XmP5jTSidyWRgGye7BMKxgi1UbChixkiVEjzqdmowd+SutQTP9hef7tVQmbLbDt5GD 4ZqqzCpbYoZXIxpWAVCHn4JNqbnx5f39Toe+igZYda0AjDrEFfy5OQ6nJpHtloHVUXi+ XFG3RNvUifnN1JbkGzu8EuiknBedFjoI83RgK6OjY46lerj0SnslYTkx2TawVwou86BL Nx9SHhft1Kx+TJpxttJeTPCZyFOplPBZTwV9LnTrfGyRZBgbfimodVE6RTNeP6a9dDC/ 2kABHPjfkQ6YzrPDzn8eNGDM60ilN5rCmWnJzxzT0R4wptGijWzbqL/Ma6H3PDI0oNGT sSAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=NLWRsHZS; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg3si15390634plb.167.2017.11.24.08.27.21; Fri, 24 Nov 2017 08:27:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=NLWRsHZS; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbdKXQ1T (ORCPT + 6 others); Fri, 24 Nov 2017 11:27:19 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61686 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753802AbdKXQ0J (ORCPT ); Fri, 24 Nov 2017 11:26:09 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vx007100; Sat, 25 Nov 2017 01:25:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vx007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540721; bh=+igcz6tMfjxxH7UHSmZUKfx1D3m3+335tw3xqCbH7JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLWRsHZSnU7yLXiDmv3WG/5ED2h0Glb1y6xjgurHrsKrwxiV0AVJFZlH8XB6r6OGk 0nC4K/hO5jZk3fyWz/fxUgqWKRYBRmk0/6bCvMjRhWuKhAnDzG9nJczguFdMpDn/3p 5y31sdWJJKqkxnX7erySKZ8gYTJv1d6LWp+OzLw3krjRLKoYFvHXrqzz8YpoSe/0pe 7mq0iFZ64+B5tZqu98lP0PW41zMkimIhg7z+gQSWT3c0bqIWjapqq1bBqKgxc9QiSo x2XNkLGO4bVTCqpQR47AdiReWZDRJRaSC/jibYBxHV8iXinzAjxSoS/mrY7Zews1R2 gxdRSQd64dU+w== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 13/22] mmc: tmio, renesas_sdhi: move Renesas-specific DMA data to renesas_sdhi.h Date: Sat, 25 Nov 2017 01:24:48 +0900 Message-Id: <1511540697-27387-14-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org struct tmio_mmc_host has "dma_dataend" and "dma_complete", but in fact, they are Renesas private data. Move them to renesas_sdhi.h Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi.h | 2 ++ drivers/mmc/host/renesas_sdhi_internal_dmac.c | 8 ++++++-- drivers/mmc/host/renesas_sdhi_sys_dmac.c | 15 ++++++++++----- drivers/mmc/host/tmio_mmc.h | 2 -- 4 files changed, 18 insertions(+), 9 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h index 9a507b3..3250dbe 100644 --- a/drivers/mmc/host/renesas_sdhi.h +++ b/drivers/mmc/host/renesas_sdhi.h @@ -39,6 +39,8 @@ struct tmio_mmc_dma { enum dma_slave_buswidth dma_buswidth; bool (*filter)(struct dma_chan *chan, void *arg); void (*enable)(struct tmio_mmc_host *host, bool enable); + struct completion dma_dataend; + struct tasklet_struct dma_complete; }; struct renesas_sdhi { diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index 691a99f..02c2724 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -132,7 +132,9 @@ renesas_sdhi_internal_dmac_abort_dma(struct tmio_mmc_host *host) { static void renesas_sdhi_internal_dmac_dataend_dma(struct tmio_mmc_host *host) { - tasklet_schedule(&host->dma_complete); + struct renesas_sdhi *priv = host_to_priv(host); + + tasklet_schedule(&priv->dma_priv.dma_complete); } static void @@ -222,10 +224,12 @@ static void renesas_sdhi_internal_dmac_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata) { + struct renesas_sdhi *priv = host_to_priv(host); + /* Each value is set to non-zero to assume "enabling" each DMA */ host->chan_rx = host->chan_tx = (void *)0xdeadbeaf; - tasklet_init(&host->dma_complete, + tasklet_init(&priv->dma_priv.dma_complete, renesas_sdhi_internal_dmac_complete_tasklet_fn, (unsigned long)host); tasklet_init(&host->dma_issue, diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c index aeb3838..c8a74b2 100644 --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c @@ -140,12 +140,15 @@ static void renesas_sdhi_sys_dmac_abort_dma(struct tmio_mmc_host *host) static void renesas_sdhi_sys_dmac_dataend_dma(struct tmio_mmc_host *host) { - complete(&host->dma_dataend); + struct renesas_sdhi *priv = host_to_priv(host); + + complete(&priv->dma_priv.dma_dataend); } static void renesas_sdhi_sys_dmac_dma_callback(void *arg) { struct tmio_mmc_host *host = arg; + struct renesas_sdhi *priv = host_to_priv(host); spin_lock_irq(&host->lock); @@ -163,7 +166,7 @@ static void renesas_sdhi_sys_dmac_dma_callback(void *arg) spin_unlock_irq(&host->lock); - wait_for_completion(&host->dma_dataend); + wait_for_completion(&priv->dma_priv.dma_dataend); spin_lock_irq(&host->lock); tmio_mmc_do_data_irq(host); @@ -173,6 +176,7 @@ static void renesas_sdhi_sys_dmac_dma_callback(void *arg) static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) { + struct renesas_sdhi *priv = host_to_priv(host); struct scatterlist *sg = host->sg_ptr, *sg_tmp; struct dma_async_tx_descriptor *desc = NULL; struct dma_chan *chan = host->chan_rx; @@ -216,7 +220,7 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) DMA_CTRL_ACK); if (desc) { - reinit_completion(&host->dma_dataend); + reinit_completion(&priv->dma_priv.dma_dataend); desc->callback = renesas_sdhi_sys_dmac_dma_callback; desc->callback_param = host; @@ -247,6 +251,7 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host) { + struct renesas_sdhi *priv = host_to_priv(host); struct scatterlist *sg = host->sg_ptr, *sg_tmp; struct dma_async_tx_descriptor *desc = NULL; struct dma_chan *chan = host->chan_tx; @@ -295,7 +300,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host) DMA_CTRL_ACK); if (desc) { - reinit_completion(&host->dma_dataend); + reinit_completion(&priv->dma_priv.dma_dataend); desc->callback = renesas_sdhi_sys_dmac_dma_callback; desc->callback_param = host; @@ -424,7 +429,7 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host, if (!host->bounce_buf) goto ebouncebuf; - init_completion(&host->dma_dataend); + init_completion(&priv->dma_priv.dma_dataend); tasklet_init(&host->dma_issue, renesas_sdhi_sys_dmac_issue_tasklet_fn, (unsigned long)host); diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index dc470d3..8b169a0 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -148,8 +148,6 @@ struct tmio_mmc_host { bool force_pio; struct dma_chan *chan_rx; struct dma_chan *chan_tx; - struct completion dma_dataend; - struct tasklet_struct dma_complete; struct tasklet_struct dma_issue; struct scatterlist bounce_sg; u8 *bounce_buf;