How to disable SMMU in my TX1 machine

I am new in using the TX1 machine. Can someone tell me the detailed steps to disable SMMU.

Hi zhouj

Please refer to below topic to see if can help:
[url]https://devtalk.nvidia.com/default/topic/984348/jetson-tx1/stability-issue-with-dma-memory-transfer-while-gpu-activity/post/5046533/#5046533[/url]

Thanks

I tried to disable smmu via the command line. It did not work. My driver caused an error in smmu. The dmesg still showed the same smmu error:

smmu_dump_pagetable(): fault_address=0x0000000083403000 pa=0xffffffffffffffff bytes=ffffffffffffffff #pte=0 in L2

Here is the link to my original question:
https://devtalk.nvidia.com/default/topic/1024418/how-dma-works-in-arm-the-dma-stopped-working-with-our-pci-driver-/#5211855

To try #14, I do not know how to apply the patch. There only has a Makefile in the folder /arch/arm64/boot/dts/.

Hi Kayccc,

I have another question:

My system currently has R24.2.1, should I upgrade it to R28? Does upgrade to R28 resolve the DMA issue, or able to disable SMMU easily?

Regards

To try #14, I do not know how to apply the patch. There only has a Makefile in the folder /arch/arm64/boot/dts/.
Are you saying you don’t have code base with you? If yes, you can download it from downloads page. Even after upgrading to R28, you may have to follow similar procedure. BTW, “0x0000000083403000” looks like a valid DMA address. Is it possible that your end point is trying to access this location after it is already freed by system??

I couldn’t say whether or not flashing R28.1 would help you, but there were some DMA issues with R24.2.1 which were fixed with R28.1.

Hi zhouj,

Have you clarified the cause and resolved the problem?
Any test result can be shared?

Thanks

I just come back from a long vacation. I am now trying to upgrade the TX1 machine to R28.1. I downloaded the file JetPack-L4T-3.1-linux-x64.run into my windows machine. What are the steps for reflashing it into my TX1 machine?

Answered in [url]How to upgrade my TX1 machine to R28.1 - Jetson TX1 - NVIDIA Developer Forums, but basically it says you can’t flash from Windows, a Linux host is required.

After upgraded to R28.1, I ran our library with DMA turned on. This time, the system freezed up so I could not see any dmesg log.

At this point, I would like to disable SMMU, or IOMMU. In .config file, I saw IOMMU is on. How can I disable it?

I downloaded a source code file, ubuntu_rootfs_src-xenial-aarch64.tbz2.

Firstly, the name confused me. I am wondering if this file has the R28.1 Kernel source for kernel re-compiling.

Secondly, I do not know how to use the file in TX1 machine.

Please help me with the detailed steps to

  1. disable IOMMU/SMMU
  2. how to re-compile the Kernel
  3. how to apply the new Kernel to the TX1 machine.

There is some SMMU info here:
[url]Jetson TX2, ioctl(dev->contfd, VFIO_SET_IOMMU, VFIO_TYPE1_IOMMU) hang up. - Jetson TX2 - NVIDIA Developer Forums

There is some information on kernel compile both in the Documentation download for R28.1 (“kernel customization”). This URL is about TX1 building of kernel for a particular module, but is probably a good information source for any kernel build:
[url]http://www.jetsonhacks.com/2017/08/07/build-kernel-ttyacm-module-nvidia-jetson-tx1/[/url]

If you don’t need to change the device tree or initrd it is just a case of copying the Image file to “/boot”. Preferably leave the original Image and use an alterate file name, then make a second entry in “/boot/extlinux/extlinux.conf” naming this new Image…you would then need a serial console to be able to pick the alternate entry at boot time. You can of course set this as the default entry without testing, but this risks not being able to boot if something goes wrong.

If you only build a module you won’t even need to copy the Image. You’d just copy the module to the correct place in “/lib/modules/$(uname -r)/” (the correct subdirectory is related to where the module is within the kernel source tree).

The initrd is itself is by default 0 bytes on R28.1 so probably you don’t need to worry about that. Updating a kernel driver itself also probably implies no need to worry about the device tree.

I read the information for the SMMU. I am wondering if there is a simple way through configuration? Our device does not support DMA with IOMMU and SMMU, so we have to disable SMMU and IOMMU. We like any approach that is simple and straight forward to do, since we have to support our customer to do it.

by reading, I like the idea of building a updated module only. For my case, to disable IOMMU or SMMU, how can I do it? Since I am now in using TX1, could you please provide detailed steps so I can learn and do it right.

Please check : [url]https://devtalk.nvidia.com/default/topic/1014290/jetson-tx2/how-to-map-kernel-memory-to-user-memory-/post/5172167/#5172167[/url]

Hi zhouj,
@zhouj I also run into this problem.Have you already slove it?
I would appreciate it if you can give me some advice.
Thanks.

No, we did not resolve the issue.