Skip to content

Commit 1a57613

Browse files
rostedttorvalds
authored andcommitted
drm/ttm: Fix compile error when CONFIG_SHMEM is not set
When CONFIG_SHMEM is not set, the following compiler error occurs: ld: vmlinux.o: in function `ttm_backup_backup_page': (.text+0x10363bc): undefined reference to `shmem_writeout' make[3]: *** [/work/build/trace/nobackup/linux.git/scripts/Makefile.vmlinux:91: vmlinux.unstripped] Error 1 This is due to the replacement of writepage and calling swap_writeout() and shmem_writeout() directly. The issue is that when CONFIG_SHMEM is not defined, shmem_writeout() is also not defined. The function ttm_backup_backup_page() called mapping->a_ops->writepage() which was then changed to call shmem_writeout() directly. Even before commit 8479851 ("mm: Remove swap_writepage() and shmem_writepage()"), it didn't make sense to call anything other than shmem_writeout() as the ttm_backup deals only with shmem folios. Have DRM_TTM config option select SHMEM to guarantee that shmem_writeout() is available. Link: https://lore.kernel.org/all/[email protected]/ Suggested-by: Hugh Dickins <[email protected]> Fixes: 8479851 ("mm: Remove swap_writepage() and shmem_writepage()") Signed-off-by: Steven Rostedt (Google) <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5abc743 commit 1a57613

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ source "drivers/gpu/drm/display/Kconfig"
188188
config DRM_TTM
189189
tristate
190190
depends on DRM && MMU
191+
select SHMEM
191192
help
192193
GPU memory management subsystem for devices with multiple
193194
GPU memory types. Will be enabled automatically if a device driver

0 commit comments

Comments
 (0)