[PATCH 4/4] sample/reserved_mem: Introduce a sample of struct page and dio support to no-map rmem

Arnd Bergmann arnd at arndb.de
Tue Jul 12 05:10:56 PDT 2022


On Tue, Jul 12, 2022 at 12:55 PM Li Chen <me at linux.beauty> wrote:
>  >
>  > This is a common limitation that gets handled automatically by setting
>  > the dma_mask of the device through the dma-ranges property in DT.
>  > When the driver does dma_alloc_coherent() or similar to gets its buffer,
>  > it will then allocate pages below this boundary.
>
> Thanks for the tip! I wasn't aware that dma-ranges can be used by devices other than PCIe controllers.

You should actually have dma-ranges listed in the parent of any DMA master
capable device, to list the exact DMA capabilities. Without this, devices
fall back to the default 32-bit address limit, which would be correct for your
video device but is often wrong in other devices.

        Arnd



More information about the linux-arm-kernel mailing list