From: Joonyoung Shim Date: Wed, 16 Sep 2015 05:16:45 +0000 (+0900) Subject: drm/exynos: fix layering violation of address X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~5798^2~10^2~17 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5e0fb1f9eb754eed8432392bfdc100ef295676cd;p=mirror_ubuntu-zesty-kernel.git drm/exynos: fix layering violation of address There is no guarantee that DMA addresses are the same as physical addresses, but dma_to_pfn() knows how to convert a dma_addr_t to a PFN which can then be converted to a struct page. Suggested-by: Russell King Signed-off-by: Joonyoung Shim Signed-off-by: Inki Dae --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index f12fbc36b120..a4fb78e43034 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -77,7 +77,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem_obj *obj) start_addr = obj->dma_addr; while (i < nr_pages) { - obj->pages[i] = phys_to_page(start_addr); + obj->pages[i] = pfn_to_page(dma_to_pfn(dev->dev, + start_addr)); start_addr += PAGE_SIZE; i++; }