mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: <vinod.koul@intel.com>, <tony@atomide.com>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<dan.j.williams@intel.com>, <dmaengine@vger.kernel.org>,
	<linux-serial@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-mmc@vger.kernel.org>, <linux-crypto@vger.kernel.org>,
	<linux-spi@vger.kernel.org>, <linux-media@vger.kernel.org>,
	<alsa-devel@alsa-project.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: [PATCH 06/13] mmc: omap: Support for deferred probing when requesting DMA channels
Date: Tue, 26 May 2015 16:26:01 +0300	[thread overview]
Message-ID: <1432646768-12532-7-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com>

Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Ulf Hansson <ulf.hansson@linaro.org>
CC: Jarkko Nikula <jarkko.nikula@bitmer.com>
---
 drivers/mmc/host/omap.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 68dd6c79c378..29238d0fbc24 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1390,20 +1390,32 @@ static int mmc_omap_probe(struct platform_device *pdev)
 	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
 	if (res)
 		sig = res->start;
-	host->dma_tx = dma_request_slave_channel_compat(mask,
+	host->dma_tx = dma_request_slave_channel_compat_reason(mask,
 				omap_dma_filter_fn, &sig, &pdev->dev, "tx");
-	if (!host->dma_tx)
+	if (IS_ERR(host->dma_tx)) {
+		ret = PTR_ERR(host->dma_tx);
+		if (ret == -EPROBE_DEFER)
+			goto err_free_dma;
+
+		host->dma_tx = NULL;
 		dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n",
 			sig);
+	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
 	if (res)
 		sig = res->start;
-	host->dma_rx = dma_request_slave_channel_compat(mask,
+	host->dma_rx = dma_request_slave_channel_compat_reason(mask,
 				omap_dma_filter_fn, &sig, &pdev->dev, "rx");
-	if (!host->dma_rx)
+	if (IS_ERR(host->dma_rx)) {
+		ret = PTR_ERR(host->dma_rx);
+		if (ret == -EPROBE_DEFER)
+			goto err_free_dma;
+
+		host->dma_rx = NULL;
 		dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n",
 			sig);
+	}
 
 	ret = request_irq(host->irq, mmc_omap_irq, 0, DRIVER_NAME, host);
 	if (ret)
-- 
2.3.5


  parent reply	other threads:[~2015-05-26 13:27 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 13:25 [PATCH 00/13] dmaengine + omap drivers: support fro deferred probing Peter Ujfalusi
2015-05-26 13:25 ` [PATCH 01/13] dmaengine: of_dma: Correct return code for of_dma_request_slave_channel in case !CONFIG_OF Peter Ujfalusi
2015-05-26 13:25 ` [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason() Peter Ujfalusi
2015-05-29  9:33   ` Vinod Koul
2015-05-29  9:42     ` Geert Uytterhoeven
2015-05-29 10:18       ` Vinod Koul
2015-05-29 14:32         ` Peter Ujfalusi
2015-06-02 12:55           ` Vinod Koul
2015-06-04 15:58             ` Peter Ujfalusi
2015-06-12 12:58               ` Vinod Koul
2015-06-22 11:31                 ` Peter Ujfalusi
2015-06-24 16:24                   ` Vinod Koul
2015-06-25 11:15                     ` Arnd Bergmann
2015-11-18 14:21                     ` Peter Ujfalusi
2015-11-18 14:29                       ` Arnd Bergmann
2015-11-18 14:41                         ` Peter Ujfalusi
2015-11-18 15:07                           ` Arnd Bergmann
2015-11-18 15:43                             ` Andy Shevchenko
2015-11-18 15:51                               ` Arnd Bergmann
2015-11-18 16:00                                 ` Andy Shevchenko
2015-11-18 16:06                                 ` Vinod Koul
2015-11-19 10:34                             ` Peter Ujfalusi
2015-11-19 11:25                               ` Arnd Bergmann
2015-11-20 10:25                                 ` Peter Ujfalusi
2015-11-20 10:58                                   ` Arnd Bergmann
2015-11-20 12:24                                     ` Andy Shevchenko
2015-11-20 12:30                                       ` Peter Ujfalusi
2015-11-20 14:08                                         ` Andy Shevchenko
2015-11-20 12:52                                     ` Peter Ujfalusi
2015-11-20 13:48                                       ` Arnd Bergmann
2015-11-18 15:46                       ` Andy Shevchenko
2015-11-19 10:36                         ` Peter Ujfalusi
2015-05-26 13:25 ` [PATCH 03/13] serial: 8250_dma: Support for deferred probing when requesting DMA channels Peter Ujfalusi
2015-05-26 14:44   ` Greg Kroah-Hartman
2015-05-27 10:41     ` Peter Ujfalusi
2015-05-27 10:41       ` Peter Ujfalusi
2015-05-26 15:08   ` Tony Lindgren
2015-05-27 10:58     ` Peter Ujfalusi
2015-05-26 13:25 ` [PATCH 04/13] mmc: omap_hsmmc: No need to check DMA channel validity at module remove Peter Ujfalusi
2015-05-28  7:20   ` Ulf Hansson
2015-05-26 13:26 ` [PATCH 05/13] mmc: omap_hsmmc: Support for deferred probing when requesting DMA channels Peter Ujfalusi
2015-05-28  7:23   ` Ulf Hansson
2015-05-26 13:26 ` Peter Ujfalusi [this message]
2015-05-26 13:26 ` [PATCH 07/13] mmc: davinci_mmc: " Peter Ujfalusi
2015-05-28  7:31   ` Ulf Hansson
2015-05-26 13:26 ` [PATCH 08/13] crypto: omap-aes - " Peter Ujfalusi
2015-05-26 13:26 ` [PATCH 09/13] crypto: omap-des " Peter Ujfalusi
2015-05-26 13:26 ` [PATCH 10/13] crypto: omap-sham - Support for deferred probing when requesting DMA channel Peter Ujfalusi
2015-05-26 13:26 ` [PATCH 11/13] spi: omap2-mcspi: Support for deferred probing when requesting DMA channels Peter Ujfalusi
2015-05-26 15:27   ` Mark Brown
2015-05-27 11:15     ` Peter Ujfalusi
2015-05-27 17:48       ` Mark Brown
2015-05-27 17:48   ` Mark Brown
2015-05-26 13:26 ` [PATCH 12/13] [media] omap3isp: Support for deferred probing when requesting DMA channel Peter Ujfalusi
2015-11-09 19:50   ` Laurent Pinchart
2015-11-10  7:56     ` Peter Ujfalusi
2015-05-26 13:26 ` [PATCH 13/13] ASoC: omap-pcm: Switch to use dma_request_slave_channel_compat_reason() Peter Ujfalusi
2015-05-27 17:48   ` Mark Brown

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=1432646768-12532-7-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=jarkko.nikula@bitmer.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vinod.koul@intel.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

all inboxes | Powered by JetHome®