linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Chunyan Zhang <zhang.chunyan@linaro.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
	Sekhar Nori <nsekhar@ti.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma
Date: Mon, 5 Nov 2018 09:55:24 +0530	[thread overview]
Message-ID: <be0a18e8-8ee6-4d4e-6dcc-6ba6e39033c9@ti.com> (raw)
In-Reply-To: <1541387810-24867-3-git-send-email-zhang.chunyan@linaro.org>

Hi,

On 05/11/18 8:46 AM, Chunyan Zhang wrote:
> sdhci-omap can support both external dma controllers via dmaengine
> framework as well as ADMA in which the controller acts as DMA master.
> 
> Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
> ---
>  drivers/mmc/host/sdhci-omap.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> index 88347ce..0a8162c 100644
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -896,6 +896,7 @@ static int sdhci_omap_probe(struct platform_device *pdev)
>  	const struct of_device_id *match;
>  	struct sdhci_omap_data *data;
>  	const struct soc_device_attribute *soc;
> +	struct resource *regs;
>  
>  	match = of_match_device(omap_sdhci_match, dev);
>  	if (!match)
> @@ -908,6 +909,10 @@ static int sdhci_omap_probe(struct platform_device *pdev)
>  	}
>  	offset = data->offset;
>  
> +	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!regs)
> +		return -ENXIO;
> +
>  	host = sdhci_pltfm_init(pdev, &sdhci_omap_pdata,
>  				sizeof(*omap_host));
>  	if (IS_ERR(host)) {
> @@ -924,6 +929,7 @@ static int sdhci_omap_probe(struct platform_device *pdev)
>  	omap_host->timing = MMC_TIMING_LEGACY;
>  	omap_host->flags = data->flags;
>  	host->ioaddr += offset;
> +	host->mapbase = regs->start;
>  
>  	mmc = host->mmc;
>  	sdhci_get_of_property(pdev);
> @@ -991,6 +997,7 @@ static int sdhci_omap_probe(struct platform_device *pdev)
>  	host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning;
>  	host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq;
>  
> +	sdhci_switch_extdma(host, true);

A number of devices using sdhci-omap supports ADMA. So switching to external
DMA shouldn't be unconditional.

IMHO sdhci.c should see if the device supports ADMA or SDMA. If not it should
try switching to external DMA and if external DMA too is not supported, it
should use PIO.

Thanks
Kishon

  reply	other threads:[~2018-11-05  4:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  3:16 [PATCH RFC 0/3] Add support for using external dma in SDHCI Chunyan Zhang
2018-11-05  3:16 ` [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices Chunyan Zhang
2018-11-06 11:16   ` Arnd Bergmann
2018-11-07  2:56     ` Chunyan Zhang
2018-11-07 14:13   ` Adrian Hunter
2018-11-05  3:16 ` [PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma Chunyan Zhang
2018-11-05  4:25   ` Kishon Vijay Abraham I [this message]
2018-11-06 12:51     ` Arnd Bergmann
2018-11-07  3:00       ` Chunyan Zhang
2018-11-09  5:27       ` Kishon Vijay Abraham I
2018-11-19 16:32         ` Ulf Hansson
2018-11-05  3:16 ` [PATCH RFC 3/3] dt-bindings: sdhci-omap: Add example for using dmaengine Chunyan Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be0a18e8-8ee6-4d4e-6dcc-6ba6e39033c9@ti.com \
    --to=kishon@ti.com \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zhang.chunyan@linaro.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).