Re: [PATCH v2] PCI: endpoint: Use EPC's device in dma_alloc_coherent/dma_free_coherent

Robin Murphy
2018-01-09T12:46:32Z

On 19/12/17 08:36, Kishon Vijay Abraham I wrote:
> After commit 723288836628bc1c08 ("of: restrict DMA configuration"),
> of_dma_configure doesn't configure the coherent_dma_mask/dma_mask
> of endpoint function device (since it doesn't have a dt node associated
> with and hence no dma-ranges property), resulting in dma_alloc_coherent
> (used in pci_epf_alloc_space) to fail.
>
> Fix it by making dma_alloc_coherent use EPC's device for allocating
> memory address as per discussion in [1]

Looks like cleaning up the API usage also cleans up the code nicely too,
yay :)

Reviewed-by: Robin Murphy <robin.murphy@arm.com>