diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3096-drm-ttm-use-the-same-attributes-when-freeing-d_page-.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3096-drm-ttm-use-the-same-attributes-when-freeing-d_page-.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3096-drm-ttm-use-the-same-attributes-when-freeing-d_page-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3096-drm-ttm-use-the-same-attributes-when-freeing-d_page-.patch new file mode 100644 index 00000000..f2437881 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3096-drm-ttm-use-the-same-attributes-when-freeing-d_page-.patch @@ -0,0 +1,42 @@ +From de39f009ae0d7c04cdb5978b0b417f29441a142a Mon Sep 17 00:00:00 2001 +From: Fuqian Huang <huangfq.daxian@gmail.com> +Date: Thu, 11 Jul 2019 11:10:21 +0800 +Subject: [PATCH 3096/4256] drm/ttm: use the same attributes when freeing + d_page->vaddr +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In function __ttm_dma_alloc_page(), d_page->addr is allocated +by dma_alloc_attrs() but freed with use dma_free_coherent() in +__ttm_dma_free_page(). +Use the correct dma_free_attrs() to free d_page->vaddr. + +Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> +Reviewed-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +index 507be7ac1165..c326ac4e6b1f 100644 +--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +@@ -285,9 +285,13 @@ static int ttm_set_pages_caching(struct dma_pool *pool, + + static void __ttm_dma_free_page(struct dma_pool *pool, struct dma_page *d_page) + { ++ unsigned long attrs = 0; + dma_addr_t dma = d_page->dma; + d_page->vaddr &= ~VADDR_FLAG_HUGE_POOL; +- dma_free_coherent(pool->dev, pool->size, (void *)d_page->vaddr, dma); ++ if (pool->type & IS_HUGE) ++ attrs = DMA_ATTR_NO_WARN; ++ ++ dma_free_attrs(pool->dev, pool->size, (void *)d_page->vaddr, dma, attrs); + + kfree(d_page); + d_page = NULL; +-- +2.17.1 + |