diff --git a/drivers/video/tegra/nvmap/nvmap_alloc.c b/drivers/video/tegra/nvmap/nvmap_alloc.c index addc5086..71678652 100644 --- a/drivers/video/tegra/nvmap/nvmap_alloc.c +++ b/drivers/video/tegra/nvmap/nvmap_alloc.c @@ -172,8 +172,13 @@ static int handle_page_alloc(struct nvmap_client *client, if (page_index < nr_page) { int nid = h->numa_id == NUMA_NO_NODE ? numa_mem_id() : h->numa_id; +#if defined(NV__ALLOC_PAGES_BULK_HAS_NO_PAGE_LIST_ARG) + allocated = __alloc_pages_bulk(gfp, nid, NULL, + nr_page, pages); +#else allocated = __alloc_pages_bulk(gfp, nid, NULL, nr_page, NULL, pages); +#endif } for (i = allocated; i < nr_page; i++) { pages[i] = nvmap_alloc_pages_exact(gfp, PAGE_SIZE, diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 1009d4f3..21e69a4c 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -89,6 +89,7 @@ endef # NV_CONFTEST_FUNCTION_COMPILE_TESTS += __alloc_disk_node_has_lkclass_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += __alloc_pages_bulk_has_no_page_list_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += __assign_str_has_no_src_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += aperture_remove_all_conflicting_devices NV_CONFTEST_FUNCTION_COMPILE_TESTS += bin_attribute_struct_mmap_has_const_bin_attribute_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 009aea0e..53273e3b 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6534,6 +6534,25 @@ compile_test() { compile_check_conftest "$CODE" "NV___ALLOC_DISK_NODE_HAS_LKCLASS_ARG" "" "types" ;; + __alloc_pages_bulk_has_no_page_list_arg) + # + # Determine if the function __alloc_pages_bulk() has an 'page_list' + # argument. + # + # In Linux v6.14, commit c8b979530f27 ("mm: alloc_pages_bulk_noprof: + # drop page_list argument") removes the 'page_list' argument from + # __alloc_pages_bulk(). + # + CODE=" + #include + unsigned long confest_alloc_pages_bulk(gfp_t gfp, int nid, int nr_pages, + struct page **page_array) { + return __alloc_pages_bulk(gfp, nid, NULL, nr_pages, page_array); + }" + + compile_check_conftest "$CODE" "NV__ALLOC_PAGES_BULK_HAS_NO_PAGE_LIST_ARG" "" "types" $1.log + ;; + aperture_remove_all_conflicting_devices) # # Determine if the function aperture_remove_all_conflicting_devices()