[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2aUjLsP70zSjkavR4-mkV9iEVCw96Vces4N15Dno8SHw@mail.gmail.com>
Date: Tue, 6 Nov 2018 12:16:00 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Chunyan Zhang <zhang.chunyan@...aro.org>
Cc: Ulf Hansson <ulf.hansson@...aro.org>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
Mark Brown <broonie@...nel.org>,
Kishon Vijay Abraham I <kishon@...com>,
Sekhar Nori <nsekhar@...com>,
Chunyan Zhang <zhang.lyra@...il.com>
Subject: Re: [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices
On 11/5/18, Chunyan Zhang <zhang.chunyan@...aro.org> wrote:
> Some standard SD host controller can support both external dma
> controllers as well as ADMA in which the controller acts as
> DMA master.
>
> Currently the generic SDHCI code supports ADMA/SDMA integrated into
> the host controller but does not have any support for external DMA
> controllers implemented using dmaengine meaning that custom code is
> needed for any systems that use a generic DMA controller with SDHCI.
>
> Signed-off-by: Chunyan Zhang <zhang.chunyan@...aro.org>
Looks good to me overall, but I think I found one small bug:
> + dma->rx_chan = dma_request_chan(mmc->parent, "rx");
> + if (IS_ERR(dma->rx_chan)) {
> + ret = PTR_ERR(dma->rx_chan);
> + if (ret == -EPROBE_DEFER && dma->tx_chan)
> + dma_release_channel(dma->tx_chan);
> +
> + dma->rx_chan = NULL;
> + pr_warn("Failed to request RX DMA channel.\n");
> + }
The error handling looks wrong here: if you get EPROBE_DEFER,
you want to skip the warning message. If you get any other error code,
you want the warning message and also the dma_release_channel()
which should be unconditional here.
Arnd
Powered by blists - more mailing lists