Hi Aleksei, I hit the same bug from raspberrypi/linux#7504 and sent a duplicate fix before I saw yours, sorry for the noise.
I tested v2 on a Raspberry Pi 5 with 6.18.39, as an out-of-tree v3d module. My reproducer fills the V3D address space and then imports a vc4 dumb buffer. Without the patch it oopses in dma_direct_unmap_sg(). With the patch the import fails with -ENOSPC (20 runs), and bo_stats and dma_buf/bufinfo are empty afterwards. Self-import of a v3d BO gives the same offset (1000 runs), a vc4 buffer imported into v3d can be mmapped and read back, and the igt v3d tests pass (82 pass, 2 skip, as without the patch). Tested-by: Roy <[email protected]> Thanks, Roy
