-
Stefano Stabellini authored
commit a4dba130 upstream. Introduce an arch specific function to find out whether a particular dma mapping operation needs to bounce on the swiotlb buffer. On ARM and ARM64, if the page involved is a foreign page and the device is not coherent, we need to bounce because at unmap time we cannot execute any required cache maintenance operations (we don't know how to find the pfn from the mfn). No change of behaviour for x86. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [ stefano: The commit needs to be slightly modified because is_device_dma_coherent is not available on kernels < 3.19, so I just removed the call, thus assuming that the device is not coherent on arm (slower but safe) ] Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> [ luis: backported to 3.16: used backport by stefano ] Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
342443e9