Re: [PATCH 13/15] mmc: sdhci-acpi: Add 64-bit DMA support

Arnd Bergmann
2014-10-21T09:33:25Z

On Tuesday 21 October 2014 12:26:23 Adrian Hunter wrote:
> + return 0;
> +
> + if (host->flags & SDHCI_USE_64_BIT_DMA) {
> + if (host->quirks2 & SDHCI_QUIRK2_BROKEN_64_BIT_DMA) {
> + host->flags &= ~SDHCI_USE_64_BIT_DMA;
> + } else {
> + err = dma_coerce_mask_and_coherent(dev,
> + DMA_BIT_MASK(64));
> + if (err)
> + dev_warn(dev, "Failed to set 64-bit DMA mask\n");
> + }
> + }
> +
> + if (err)
> + err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
> +
> + c->dma_setup = !err;
>

Never use dma_coerce_mask_and_coherent(), it will ignore limitations of
the upstream bus. Use dma_set_mask_and_coherent instead. If it fails,
I think you need to clear the SDHCI_USE_64_BIT_DMA flag.

Arnd