Skip to content

xuantie: nna: select SYNC_FILE#93

Merged
sterling-teng merged 1 commit into
RVCK-Project:rvck-6.6from
woqidaideshi:rvck-6.6
Aug 20, 2025
Merged

xuantie: nna: select SYNC_FILE#93
sterling-teng merged 1 commit into
RVCK-Project:rvck-6.6from
woqidaideshi:rvck-6.6

Conversation

@woqidaideshi
Copy link
Copy Markdown
Contributor

KUnit error:

ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
vha_common.c:(.text+0x4da): undefined reference to `dma_fence_release'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `dma_fence_put.part.0':
vha_common.c:(.text+0x52e): undefined reference to `dma_fence_release'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `_vha_in_merged_sync_cb':
vha_common.c:(.text+0x58c): undefined reference to `dma_fence_release'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `_vha_in_sync_cb':
vha_common.c:(.text+0x5e4): undefined reference to `dma_fence_release'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L255':
vha_common.c:(.text+0xe4a): undefined reference to `dma_fence_remove_callback'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
vha_common.c:(.text+0xe96): undefined reference to `dma_fence_release'
ld: vha_common.c:(.text+0xea2): undefined reference to `dma_fence_signal'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L655':
vha_common.c:(.text+0x28e4): undefined reference to `sync_file_get_fence'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L659':
vha_common.c:(.text+0x28fc): undefined reference to `dma_fence_add_callback'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L657':
vha_common.c:(.text+0x295e): undefined reference to `dma_fence_signal'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
vha_common.c:(.text+0x2982): undefined reference to `dma_fence_release'
ld: vha_common.c:(.text+0x2ac4): undefined reference to `dma_fence_release'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L768':
vha_common.c:(.text+0x2c9e): undefined reference to `dma_fence_context_alloc'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
vha_common.c:(.text+0x2cb0): undefined reference to `dma_fence_array_create'
ld: vha_common.c:(.text+0x2cbe): undefined reference to `sync_file_create'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L774':
vha_common.c:(.text+0x2ce8): undefined reference to `dma_fence_add_callback'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `vha_buf_needs_inval':
vha_common.c:(.text+0x2ec6): undefined reference to `sync_file_get_fence'
ld: vha_common.c:(.text+0x2ee6): undefined reference to `dma_fence_add_callback'
ld: vha_common.c:(.text+0x2f2e): undefined reference to `dma_fence_context_alloc'
ld: vha_common.c:(.text+0x2f40): undefined reference to `dma_fence_array_create'
ld: vha_common.c:(.text+0x2f52): undefined reference to `sync_file_create'
ld: vha_common.c:(.text+0x2f7c): undefined reference to `dma_fence_add_callback'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L812':
vha_common.c:(.text+0x2fbe): undefined reference to `dma_fence_signal'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
vha_common.c:(.text+0x2ffe): undefined reference to `sync_file_get_fence'
ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `vha_create_output_sync':
vha_common.c:(.text+0x3038): undefined reference to `dma_fence_add_callback'
ld: vha_common.c:(.text+0x308a): undefined reference to `dma_fence_signal'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_man.o: in function `.L229':
img_mem_man.c:(.text+0xba4): undefined reference to `dma_fence_context_alloc'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_man.o: in function `.L231':
img_mem_man.c:(.text+0xbbe): undefined reference to `dma_fence_init'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_man.o: in function `.L248':
img_mem_man.c:(.text+0xc5c): undefined reference to `dma_fence_free'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_man.o: in function `.L0 ':
img_mem_man.c:(.text+0xcaa): undefined reference to `dma_fence_signal'
ld: img_mem_man.c:(.text+0x1872): undefined reference to `dma_fence_signal'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_man.o: in function `.LANCHOR2':
img_mem_man.c:(.data+0x28): undefined reference to `dma_fence_default_wait'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_carveout.o: in function `carveout_heap_free':
img_mem_carveout.c:(.text+0x1b2): undefined reference to `dma_buf_put'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_carveout.o: in function `.L0 ':
img_mem_carveout.c:(.text+0x2c4): undefined reference to `dma_buf_export'
ld: img_mem_carveout.c:(.text+0x2e0): undefined reference to `dma_buf_fd'
ld: img_mem_carveout.c:(.text+0x42e): undefined reference to `dma_buf_put'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_unified.o: in function `.L0 ':
img_mem_unified.c:(.text+0x356): undefined reference to `dma_buf_export'
ld: img_mem_unified.c:(.text+0x374): undefined reference to `dma_buf_fd'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_unified.o: in function `.L80':
img_mem_unified.c:(.text+0x3ca): undefined reference to `dma_buf_put'
ld: drivers/soc/xuantie/nna/img_mem/img_mem_unified.o: in function `unified_end_cpu_access_dmabuf':
img_mem_unified.c:(.text+0xa28): undefined reference to `dma_buf_put'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L124':
video_memory.c:(.text+0x5ce): undefined reference to `dma_buf_unmap_attachment'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L112':
video_memory.c:(.text+0x5da): undefined reference to `dma_buf_detach'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L151':
video_memory.c:(.text+0x5e4): undefined reference to `dma_buf_put'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L431':
video_memory.c:(.text+0x104a): undefined reference to `dma_buf_get'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L395':
video_memory.c:(.text+0x1066): undefined reference to `dma_buf_attach'
ld: video_memory.c:(.text+0x1076): undefined reference to `dma_buf_map_attachment'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L0 ':
video_memory.c:(.text+0x121e): undefined reference to `dma_buf_fd'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L392':
video_memory.c:(.text+0x1398): undefined reference to `dma_buf_export'
ld: drivers/soc/xuantie/video_memory/video_memory.o: in function `.L412':
video_memory.c:(.text+0x13cc): undefined reference to `dma_buf_unmap_attachment'
make[3]: *** [../scripts/Makefile.vmlinux:37: vmlinux] Error 1
make[2]: *** [/home/jenkins/agent/workspace/rvck-debug-test/kunit-test/work/Makefile:1172: vmlinux] Error 2
make[1]: *** [/home/jenkins/agent/workspace/rvck-debug-test/kunit-test/work/Makefile:234: __sub-make] Error 2
make: *** [Makefile:234: __sub-make] Error 2

@sterling-teng
Copy link
Copy Markdown
Contributor

需要按照规范改下补丁的提交信息。因为该补丁为rava接入时产生,需要紧急合入,请尽快更新补丁。

riscv inclusion
category: bugfix
bugzilla: ruyisdk/linux-xuantie-kernel#214
CVE: NA

--------------------------------

Make VHA select SYNC_FILE to avoid KUnit test errors:

    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
    vha_common.c:(.text+0x4da): undefined reference to `dma_fence_release'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `dma_fence_put.part.0':
    vha_common.c:(.text+0x52e): undefined reference to `dma_fence_release'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `_vha_in_merged_sync_cb':
    vha_common.c:(.text+0x58c): undefined reference to `dma_fence_release'
    ...
    ld: vha_common.c:(.text+0x2cbe): undefined reference to `sync_file_create'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L774':
    vha_common.c:(.text+0x2ce8): undefined reference to `dma_fence_add_callback'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `vha_buf_needs_inval':
    vha_common.c:(.text+0x2ec6): undefined reference to `sync_file_get_fence'
    ld: vha_common.c:(.text+0x2ee6): undefined reference to `dma_fence_add_callback'
    ld: vha_common.c:(.text+0x2f2e): undefined reference to `dma_fence_context_alloc'
    ld: vha_common.c:(.text+0x2f40): undefined reference to `dma_fence_array_create'
    ld: vha_common.c:(.text+0x2f52): undefined reference to `sync_file_create'

Signed-off-by: Yafen Fang <yafen@iscas.ac.cn>
@woqidaideshi
Copy link
Copy Markdown
Contributor Author

@sterling-teng 已更新。

@sterling-teng sterling-teng merged commit 32c7ba2 into RVCK-Project:rvck-6.6 Aug 20, 2025
cp0613 pushed a commit to cp0613/rvck that referenced this pull request Feb 2, 2026
[ Upstream commit 24e17a2 ]

The xfstests' test-case generic/073 leaves HFS+ volume
in corrupted state:

sudo ./check generic/073
FSTYP -- hfsplus
PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.17.0-rc1+ RVCK-Project#4 SMP PREEMPT_DYNAMIC Wed Oct 1 15:02:44 PDT 2025
MKFS_OPTIONS -- /dev/loop51
MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch

generic/073 _check_generic_filesystem: filesystem on /dev/loop51 is inconsistent
(see XFSTESTS-2/xfstests-dev/results//generic/073.full for details)

Ran: generic/073
Failures: generic/073
Failed 1 of 1 tests

sudo fsck.hfsplus -d /dev/loop51
** /dev/loop51
Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K.
Executing fsck_hfs (version 540.1-Linux).
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
Invalid directory item count
(It should be 1 instead of 0)
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000
CBTStat = 0x0000 CatStat = 0x00004000
** Repairing volume.
** Rechecking volume.
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume untitled was repaired successfully.

The test is doing these steps on final phase:

mv $SCRATCH_MNT/testdir_1/bar $SCRATCH_MNT/testdir_2/bar
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/testdir_1
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo

So, we move file bar from testdir_1 into testdir_2 folder. It means that HFS+
logic decrements the number of entries in testdir_1 and increments number of
entries in testdir_2. Finally, we do fsync only for testdir_1 and foo but not
for testdir_2. As a result, this is the reason why fsck.hfsplus detects the
volume corruption afterwards.

This patch fixes the issue by means of adding the
hfsplus_cat_write_inode() call for old_dir and new_dir in
hfsplus_rename() after the successful ending of
hfsplus_rename_cat(). This method makes modification of in-core
inode objects for old_dir and new_dir but it doesn't save these
modifications in Catalog File's entries. It was expected that
hfsplus_write_inode() will save these modifications afterwards.
However, because generic/073 does fsync only for testdir_1 and foo
then testdir_2 modification hasn't beed saved into Catalog File's
entry and it was flushed without this modification. And it was
detected by fsck.hfsplus. Now, hfsplus_rename() stores in Catalog
File all modified entries and correct state of Catalog File will
be flushed during hfsplus_file_fsync() call. Finally, it makes
fsck.hfsplus happy.

sudo ./check generic/073
FSTYP         -- hfsplus
PLATFORM      -- Linux/x86_64 hfsplus-testing-0001 6.18.0-rc3+ RVCK-Project#93 SMP PREEMPT_DYNAMIC Wed Nov 12 14:37:49 PST 2025
MKFS_OPTIONS  -- /dev/loop51
MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch

generic/073 32s ...  32s
Ran: generic/073
Passed all 1 tests

Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
cc: Yangtao Li <frank.li@vivo.com>
cc: linux-fsdevel@vger.kernel.org
Link: https://lore.kernel.org/r/20251112232522.814038-1-slava@dubeyko.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants