2020-01-07 10:41:33

by Peter Ujfalusi

[permalink] [raw]
Subject: [PATCH v2] mmc: bcm2835: Use dma_request_chan() instead dma_request_slave_channel()

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

By using dma_request_chan() directly the driver can support deferred
probing against DMA.

Signed-off-by: Peter Ujfalusi <[email protected]>
---
Hi,

Changes since v1:
- jump to err: instead of returning in case of EPROBE_DEFER

Regards,
Peter

drivers/mmc/host/bcm2835.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 99f61fd2a658..c3d949847cbd 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -1393,7 +1393,17 @@ static int bcm2835_probe(struct platform_device *pdev)
host->dma_chan = NULL;
host->dma_desc = NULL;

- host->dma_chan_rxtx = dma_request_slave_channel(dev, "rx-tx");
+ host->dma_chan_rxtx = dma_request_chan(dev, "rx-tx");
+ if (IS_ERR(host->dma_chan_rxtx)) {
+ ret = PTR_ERR(host->dma_chan_rxtx);
+ host->dma_chan_rxtx = NULL;
+
+ if (ret == -EPROBE_DEFER)
+ goto err;
+
+ /* Ignore errors to fall back to PIO mode */
+ }
+

clk = devm_clk_get(dev, NULL);
if (IS_ERR(clk)) {
--
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


2020-01-07 10:51:00

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH v2] mmc: bcm2835: Use dma_request_chan() instead dma_request_slave_channel()

On Tue, 2020-01-07 at 12:40 +0200, Peter Ujfalusi wrote:
> dma_request_slave_channel() is a wrapper on top of dma_request_chan()
> eating up the error code.
>
> By using dma_request_chan() directly the driver can support deferred
> probing against DMA.
>
> Signed-off-by: Peter Ujfalusi <[email protected]>
> ---
> Hi,
>
> Changes since v1:
> - jump to err: instead of returning in case of EPROBE_DEFER
>
> Regards,
> Peter

Reviewed-by: Nicolas Saenz Julienne <[email protected]>

Thanks,
Nicolas

>
> drivers/mmc/host/bcm2835.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
> index 99f61fd2a658..c3d949847cbd 100644
> --- a/drivers/mmc/host/bcm2835.c
> +++ b/drivers/mmc/host/bcm2835.c
> @@ -1393,7 +1393,17 @@ static int bcm2835_probe(struct platform_device *pdev)
> host->dma_chan = NULL;
> host->dma_desc = NULL;
>
> - host->dma_chan_rxtx = dma_request_slave_channel(dev, "rx-tx");
> + host->dma_chan_rxtx = dma_request_chan(dev, "rx-tx");
> + if (IS_ERR(host->dma_chan_rxtx)) {
> + ret = PTR_ERR(host->dma_chan_rxtx);
> + host->dma_chan_rxtx = NULL;
> +
> + if (ret == -EPROBE_DEFER)
> + goto err;
> +
> + /* Ignore errors to fall back to PIO mode */
> + }
> +
>
> clk = devm_clk_get(dev, NULL);
> if (IS_ERR(clk)) {


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part

2020-01-16 14:42:26

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v2] mmc: bcm2835: Use dma_request_chan() instead dma_request_slave_channel()

On Tue, 7 Jan 2020 at 11:40, Peter Ujfalusi <[email protected]> wrote:
>
> dma_request_slave_channel() is a wrapper on top of dma_request_chan()
> eating up the error code.
>
> By using dma_request_chan() directly the driver can support deferred
> probing against DMA.
>
> Signed-off-by: Peter Ujfalusi <[email protected]>

I thought I had already applied this, but maybe I didn't publish my
branch back then.

Oh well, please double check so the code has been included in my next branch.

Kind regards
Uffe


> ---
> Hi,
>
> Changes since v1:
> - jump to err: instead of returning in case of EPROBE_DEFER
>
> Regards,
> Peter
>
> drivers/mmc/host/bcm2835.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
> index 99f61fd2a658..c3d949847cbd 100644
> --- a/drivers/mmc/host/bcm2835.c
> +++ b/drivers/mmc/host/bcm2835.c
> @@ -1393,7 +1393,17 @@ static int bcm2835_probe(struct platform_device *pdev)
> host->dma_chan = NULL;
> host->dma_desc = NULL;
>
> - host->dma_chan_rxtx = dma_request_slave_channel(dev, "rx-tx");
> + host->dma_chan_rxtx = dma_request_chan(dev, "rx-tx");
> + if (IS_ERR(host->dma_chan_rxtx)) {
> + ret = PTR_ERR(host->dma_chan_rxtx);
> + host->dma_chan_rxtx = NULL;
> +
> + if (ret == -EPROBE_DEFER)
> + goto err;
> +
> + /* Ignore errors to fall back to PIO mode */
> + }
> +
>
> clk = devm_clk_get(dev, NULL);
> if (IS_ERR(clk)) {
> --
> Peter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>