diff --git a/drivers/video/tegra/nvmap/nvmap_alloc.c b/drivers/video/tegra/nvmap/nvmap_alloc.c index 815fa0eb..fd410081 100644 --- a/drivers/video/tegra/nvmap/nvmap_alloc.c +++ b/drivers/video/tegra/nvmap/nvmap_alloc.c @@ -573,8 +573,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 } #endif for (i = allocated; i < nr_page; i++) { diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index c40f8138..96bb6d58 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 3e353e54..0c95272a 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6518,6 +6518,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()