ARM: dma-mapping: Allow unmap non page backed address
Hiroshi Doyu [Mon, 28 Jan 2013 11:10:42 +0000 (13:10 +0200)]
pfn_valid() should be done in a caller function if *needed*. map/unmap
care about address mapping only but should not care about if the
address is a valid page or not. This allows to unmap out of kernel
control address by dma mapping API, for exmaple ones mapped by
dma_map_linear(-ENXIO)

bug 1222494

Change-Id: I4d59e4078edf3c8876da8f4492bd0c306b693815
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/194630
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

arch/arm/mm/dma-mapping.c

index 601ccd0..d84f331 100644 (file)
@@ -1852,9 +1852,6 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
        if (!iova)
                return;
 
-       if (WARN_ON(!pfn_valid(page_to_pfn(page))))
-               return;
-
        if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
                __dma_page_dev_to_cpu(page, offset, size, dir);