Translation fault while using mmu-600 (only when dma alloc is done during application on the fly)
김찬
ckim at etri.re.kr
Fri Mar 22 05:17:09 EDT 2024
Hello all, These several days we are having a difficulty in our linux device driver development.
case A ) Here we allocate the dma buffer for our accelerator device during the device driver(a platform driver) initialization and we don't have problem. That is, we use kmalloc + dma_map_single during the driver initialization and after the boot is complete, we run the application which uses the driver. During the application, the driver just calls dma_sync_single_for_device function and our accelerator device actually access the dma buffer with no problem. (no translation fault).
case B) Here we allocate the dma buffer for our accelerator device while the application runs after the boot (the buffer is not allocated during the drive initialization). While the application runs, the driver does the kmalloc + dma_map_single + dma_sync_single_for_device and then when then device accesses the dma buffer, we see translation fault. By printing the SMMU event data, we know it's for data read access, and the class is 'b10 which is 'Input address caused fault'. and it is from the first stage (S2=0).
We know that the SMMU reads STE, CD and 3 entries of translation table. (we use 48bit address). Can we know in what stage of this 5 stages the fault arose? By the way the io virtual address starts with 0x7ffff~ (48bit) in both cases. Could anyone suggest us what information to look into now?
Thank you,
Best regards,Chan Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20240322/6b886096/attachment.html>
More information about the Kernelnewbies
mailing list