Re: [PATCH V3 1/3] mmc: sdhci: add support for using external DMA devices

From: Chunyan Zhang
Date: Mon Dec 03 2018 - 22:15:19 EST


Hi Faiz,

On Mon, 3 Dec 2018 at 21:55, Faiz Abbas <faiz_abbas@xxxxxx> wrote:
>
> Hi,
>
> On 03/12/18 5:45 PM, Faiz Abbas wrote:
> > Hi,
> >
> >> +static void sdhci_external_dma_prepare_data(struct sdhci_host *host,
> >> + struct mmc_command *cmd)
> >> +{
> >
> > Please add a condition for data == NULL here. This was already pointed
> > out by Adrian in v2.

The check for data is added in sdhci_external_dma_setup() .

> >
> > My test with an am335x-evm failed with these patches. Looks like the
> > very first SDIO commands failing.

I guess you didn't add 'dmas' in device tree, like patch 3 shows.

> >
> > https://pastebin.ubuntu.com/p/Y2RDjSKpgd/
> >
> > Currently am335x-evm is using omap_hsmmc driver. I added the following
> > patch to make it work with sdhci_omap.
> >
> > https://pastebin.ubuntu.com/p/VTGrCbJxY3/
> >
> > Will look deeper into this. Please ping if you need any more information.
> >
>
> So I disabled DMA in the driver altogether and still got the same
> messages on am335x-evm in PIO mode. Looks like something more is
> required for it to be supported.
>
> I instead shifted to a dra71-evm which supports both ADMA and external
> DMA. Here is the log:
>
> https://pastebin.ubuntu.com/p/mcJmgcjQsp/
>
> The interface fundamentally works but it complains with the following error:
>

Yes, it switched back to ADMA/PIO since sdhci couldn't find 'dmas'
property in devicetree.

> [3.111693] Failed to request TX DMA channel.

Ok, I will add a check in sdhci-omap.c before switching to external
dma, that should be able to avoid this error logs.

Thanks for the review and test!

Chunyan