[PATCH] of/platform: Initialise AMBA default DMA masks

Linus Walleij linus.walleij at linaro.org
Tue Aug 28 13:25:55 UTC 2018


On Tue, Aug 28, 2018 at 11:21 AM Christoph Hellwig <hch at lst.de> wrote:

> > +     dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > +     if (!dev->dev.dma_mask)
> > +             dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
>
> We should never set dma_mask to point to the coherent_dma_mask,
> as that will cause problems with devices that have different
> mask for the two.
>
> How about something like this?
(...)
> +       u64                     dma_mask;

We did that before, so this becomes effectively a revert of:
commit 446b2a9380b64b9d7410d86ee8226031e03645cf

    DMA-API: amba: get rid of separate dma_mask

    AMBA Primecell devices always treat streaming and coherent DMA exactly
    the same, so there's no point in having the masks separated.

So there is some history around this.

There is also some code in drivers/amba/bus.c affected by that
and I need to look over all static amba device allocations if we
reintroduce this.

That said, the remaining static allocations (a.k.a. boardfiles) appear
to be very few and very limited, almost all systems use device tree
or ACPI or iterative dynamic allocation (from amba/bus.c functions)
of the amba devices now.

Do you think we can proceed with this patch or do you want me to
revert the split back?

FWIW the platform devices have the same problem, but I know
I know, two wrongs does not make one right :/

Yours,
Linus Walleij


More information about the dri-devel mailing list