From c69cddda5ddd12334248ab5f3929f5d3e99cb65f Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 11 Sep 2024 14:00:44 +0100 Subject: [PATCH] video: tegra: nvmap: Fix build for Linux v6.12 In Linux v6.12, commit ("4ffca5a96678 mm: support only one page_type per page") removed the definition PAGE_MAPCOUNT_RESERVE and this breaks the build for NVMAP. The function 'page_has_type()' was added in Linux v5.0 and performs the necessary check and so use this instead to fix the build. Bug 4593750 Change-Id: Iaa7393ae11de9730b4ec876a971223e62a7f3f7d Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217428 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/video/tegra/nvmap/nvmap_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c index ac1f04b8..aaf5c505 100644 --- a/drivers/video/tegra/nvmap/nvmap_dev.c +++ b/drivers/video/tegra/nvmap/nvmap_dev.c @@ -784,7 +784,7 @@ static int nvmap_page_mapcount(struct page *page) int mapcount = atomic_read(&page->_mapcount) + 1; /* Handle page_has_type() pages */ - if (mapcount < PAGE_MAPCOUNT_RESERVE + 1) + if (page_has_type(page)) mapcount = 0; if (unlikely(PageCompound(page))) #if defined(NV_FOLIO_ENTIRE_MAPCOUNT_PRESENT) /* Linux v5.18 */