Hello!
I’ve been having a weird problem with using the /dev/ttyTHS1 UART (&uarta on DeviceTree, pins 203, 205) on Jetson Orin Nano.
When receiving small packets (~ 12 bytes) on any baud rate (tested between 115200 and 500000) everything works fine. However, when trying to receive bigger packets (~24 bytes), I get errors in dmesg and corrupted data.
dmesg output during the errors
[ 867.891028] nvidia_smmu_context_fault_bank: 24 callbacks suppressed
[ 867.891044] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.891318] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.891456] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.891593] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.891861] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.891997] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.892265] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.892402] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202000, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.892538] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202040, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.892806] arm-smmu 12000000.iommu: Unhandled context fault: fsr=0x402, iova=0x80202040, fsynr=0x450011, cbfrsynra=0xc04, cb=0
[ 867.893348] tegra-mc 2c00000.memory-controller: unknown: secure write @0x00000003ffffff00: VPR violation ((null))
[ 867.893357] tegra-mc 2c00000.memory-controller: unknown: secure write @0x00000003ffffff00: Route Sanity error ((null))
[ 867.895636] tegra-mc 2c00000.memory-controller: unknown: secure write @0x00000003ffffff00: VPR violation ((null))
[ 867.895643] tegra-mc 2c00000.memory-controller: unknown: secure write @0x00000003ffffff00: Route Sanity error ((null))
[ 867.897913] tegra-mc 2c00000.memory-controller: unknown: secure write @0x00000003ffffff00: VPR violation ((null))
[ 867.897919] tegra-mc 2c00000.memory-controller: unknown: secure write @0x00000003ffffff00: Route Sanity error ((null))
my-overlay.dtsi
fragment@6 {
target = <&uarta>;
__overlay__ {
status = "okay";
};
};
From the errors it looks like the issue was from dma, so I disabled it on the /dev/ttyTHS1 UART by setting dma-names to none and now the data is being received correctly even for larger data packets.
my-overlay-fix.dtsi
fragment@6 {
target = <&uarta>;
__overlay__ {
/*
* Override the inherited dma-names so the driver's
* of_property_match_string(np, "dma-names", "rx"/"tx")
* misses, setting use_rx_pio/use_tx_pio = true.
* /delete-property/ would be cleaner but doesn't
* survive fdtoverlay reliably.
*/
dma-names = "none", "none";
status = "okay";
};
};
This is a very weird problem and I can’t explain why would DMA have these issues. Those bigger packets are also not being spammed - they are in multiple hundred millisecond intervals.
For example, on Jetson TX2NX this works just fine without editing anything in UART DeviceTree configuration.
What could be the options to get DMA working correctly?