The patch titled Subject: mm/gup: make migrate_device_page() fails always if !CONFIG_DEVICE_PRIVATE has been added to the -mm tree. Its filename is mm-gupc-migrate-device-coherent-pages-when-pinning-instead-of-failing-fix.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-gupc-migrate-device-coherent-pages-when-pinning-instead-of-failing-fix.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-gupc-migrate-device-coherent-pages-when-pinning-instead-of-failing-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: SeongJae Park <sj@xxxxxxxxxx> Subject: mm/gup: make migrate_device_page() fails always if !CONFIG_DEVICE_PRIVATE Commit 7059ac82be44 ("mm/gup.c: migrate device coherent pages when pinning instead of failing") in -mm tree[1] introduces 'migrate_device_page()', which uses several functions that defined under CONFIG_DEVICE_RIVATE. As a result, build under 'CONFIG_MIGRATION && !CONFIG_DEVICE_PRIVATE' fails as below. LD .tmp_vmlinux.kallsyms1 mm/gup.o: In function `migrate_device_page': /linux/mm/gup.c:1856: undefined reference to `migrate_vma_setup' /linux/mm/gup.c:1876: undefined reference to `migrate_vma_pages' /linux/mm/gup.c:1879: undefined reference to `migrate_vma_finalize' /linux/Makefile:1222: recipe for target 'vmlinux' failed make[1]: *** [vmlinux] Error 1 This commit fixes it by implementing an always-failing version of the function for !CONFIG_DEVICE_PRIVATE'. [1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-gupc-migrate-device-coherent-pages-when-pinning-instead-of-failing.patch Link: https://lkml.kernel.org/r/20220209094158.21941-3-sj@xxxxxxxxxx Signed-off-by: SeongJae Park <sj@xxxxxxxxxx> Cc: Alistair Popple <apopple@xxxxxxxxxx> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/gup.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/mm/gup.c~mm-gupc-migrate-device-coherent-pages-when-pinning-instead-of-failing-fix +++ a/mm/gup.c @@ -1834,6 +1834,7 @@ struct page *get_dump_page(unsigned long #endif /* CONFIG_ELF_CORE */ #ifdef CONFIG_MIGRATION +#ifdef CONFIG_DEVICE_PRIVATE /* * Migrates a device coherent page back to normal memory. Caller should have a * reference on page which will be copied to the new page if migration is @@ -1887,6 +1888,14 @@ static struct page *migrate_device_page( return dpage; } +#else +static inline struct page *migrate_device_page(struct page *page, + unsigned int gup_flags) +{ + return NULL; +} +#endif /* CONFIG_DEVICE_PRIVATE */ + /* * Check whether all pages are pinnable, if so return number of pages. If some _ Patches currently in -mm which might be from sj@xxxxxxxxxx are mm-gupc-migrate-device-coherent-pages-when-pinning-instead-of-failing-fix.patch mm-damon-dbgfs-init_regions-use-target-index-instead-of-target-id.patch docs-admin-guide-mm-damon-usage-update-for-changed-initail_regions-file-input.patch mm-damon-core-move-damon_set_targets-into-dbgfs.patch mm-damon-remove-the-target-id-concept.patch