Orin nx 串口崩溃,会导致系统重启

orin nx 16g客户自定义板子
jp5.1.5

波特率9600
orin nx 串口崩溃,会导致系统重启,log如下

Apr 15 19:14:54 tegra-ubuntu kernel: [   23.949959] pwm-tegra-tachometer 39c0000.tachometer: Tachometer Overflow is detected
Apr 15 19:15:34 tegra-ubuntu kernel: [   64.295508] cpufreq: cpu4,cur:1868000,set:1728000,set ndiv:135
Apr 15 19:42:08 tegra-ubuntu kernel: [ 1658.010516] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:08 tegra-ubuntu kernel: [ 1658.518391] serial-tegra 3100000.serial: RxData PIO to tty layer failed
Apr 15 19:42:09 tegra-ubuntu kernel: [ 1659.034404] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:09 tegra-ubuntu kernel: [ 1659.550595] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:10 tegra-ubuntu kernel: [ 1660.090585] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:10 tegra-ubuntu kernel: [ 1660.602615] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:11 tegra-ubuntu kernel: [ 1661.114603] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:11 tegra-ubuntu kernel: [ 1661.653756] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:12 tegra-ubuntu kernel: [ 1662.166428] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:12 tegra-ubuntu kernel: [ 1662.678393] serial-tegra 3100000.serial: RxData PIO to tty layer failed
Apr 15 19:42:13 tegra-ubuntu kernel: [ 1663.190405] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:13 tegra-ubuntu kernel: [ 1663.706609] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:14 tegra-ubuntu kernel: [ 1664.218600] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:14 tegra-ubuntu kernel: [ 1664.730574] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:15 tegra-ubuntu kernel: [ 1665.242588] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:16 tegra-ubuntu kernel: [ 1665.758608] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed
Apr 15 19:42:16 tegra-ubuntu kernel: [ 1666.307238] serial-tegra 3100000.serial: RxData DMA copy to tty layer failed

kern.zip (53.0 MB)

Hi sorry.shao,

Is the issue specific to 9600 baudrate?
Could it work with 115200 baudrate?

From the failed log you shared, it seems the issue is caused from DMA of UART1(3100000.serial).
Please also share the full device tree for further check.

是因为3100000.serial没有没enable导致的吗

dtb的文件如下

/*
 * Copyright (c) 2016-2021, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * tegra234-soc-uart.dtsi: Tegra234 soc dtsi file for UART instances
 */

/ {
	aliases {
		serial0 = &uarta;
		serial1 = &uartb;
		serial2 = &uartc;
		serial3 = &uartd;
		serial4 = &uarte;
		serial5 = &uartf;
		serial7 = &uarth;
	};

	uarta: serial@3100000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0x03100000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTA 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 8>, <&gpcdma 8>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTA>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTA>;
		reset-names = "serial";
		status = "disabled";
	};

	uartb: serial@3110000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0x03110000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTB 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 9>, <&gpcdma 9>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTB>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTB>;
		reset-names = "serial";
		status = "okay";
	};

	uartc: serial@c280000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0xc280000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTC 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 3>, <&gpcdma 3>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTC>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTC>;
		reset-names = "serial";
		status = "disabled";
	};

	uartd: serial@3130000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0x03130000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTD 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 19>, <&gpcdma 19>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTD>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTD>;
		reset-names = "serial";
		status = "disabled";
	};

	uarte: serial@3140000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0x03140000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTE 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 20>, <&gpcdma 20>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTE>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTE>;
		reset-names = "serial";
		status = "disabled";
	};

	uartf: serial@3150000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0x03150000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTF 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 12>, <&gpcdma 12>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTF>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTF>;
		reset-names = "serial";
		status = "disabled";
	};

	uarth: serial@3170000 {
		compatible = "nvidia,tegra194-hsuart";
		iommus = <&smmu_niso0 TEGRA_SID_NISO0_GPCDMA_0>;
		dma-coherent;
		reg = <0x0 0x3170000 0x0 0x10000>;
		reg-shift = <2>;
		interrupts = <0 TEGRA234_IRQ_UARTH 0x04>;
		nvidia,memory-clients = <14>;
		dmas = <&gpcdma 13>, <&gpcdma 13>;
		dma-names = "rx", "tx";
		clocks = <&bpmp_clks TEGRA234_CLK_UARTH>,
			<&bpmp_clks TEGRA234_CLK_PLLP_OUT0>;
		clock-names = "serial", "parent";
		resets = <&bpmp_resets TEGRA234_RESET_UARTH>;
		reset-names = "serial";
		status = "disabled";
	};

	uarti: serial@31d0000 {
		compatible = "arm,sbsa-uart";
		reg = <0x0 0x31d0000 0x0 0x10000>;
		interrupts = <0x0 TEGRA234_IRQ_UARTI 0x04>;
		current-speed = <115200>;
		status = "disabled";
	};

	uartj: serial@c270000 {
		compatible = "arm,sbsa-uart";
		reg = <0x0 0xc270000 0x0 0x10000>;
		interrupts = <0x0 TEGRA234_IRQ_UARTJ 0x04>;
		current-speed = <115200>;
		status = "disabled";
	};

	combined-uart {
		compatible = "nvidia,tegra194-tcu";
		reg = <0x0 0x3c10000 0x0 0x4   /* TOP0_HSP_SM_0_1_BASE */
		       0x0 0xc168000 0x0 0x4       /* AON_HSP_SM_1_BASE */
		       0x0 0x3c00000 0x0 0x1000>; /* TOP0_HSP_COMMON_BASE */
		interrupts = <0 TEGRA234_IRQ_TOP0_HSP_SHARED_0 0x04>;
		mboxes = <&hsp_top TEGRA_HSP_MBOX_TYPE_SM TEGRA_HSP_SM_RX(0)>,
		         <&aon_hsp TEGRA_HSP_MBOX_TYPE_SM TEGRA_HSP_SM_TX(1)>;
		mbox-names = "rx", "tx";
		console-port;
		combined-uart;
		status = "disabled";
	};
};

如下是反编译的设备树文件
tegra234-p3767-0000-p3509-a02.zip (49.9 KB)

From the dts you shared, serial@3100000 is enabled.

Could you try removing the following lines for the dma related properties?

	serial@3100000 {
		compatible = "nvidia,tegra194-hsuart";
		reg = <0x00 0x3100000 0x00 0x10000>;
		reg-shift = <0x02>;
		interrupts = <0x00 0x70 0x04>;
		clock-frequency = <0x18519600>;
		iommus = <0x07 0x04>;
-		dma-coherent;
		nvidia,memory-clients = <0x0e>;
-		dmas = <0x40 0x08 0x40 0x08>;
-		dma-names = "rx\0tx";
		clocks = <0x02 0x9b 0x02 0x66>;
		clock-names = "serial\0parent";
		resets = <0x02 0x64>;
		reset-names = "serial";
		status = "okay";
		phandle = <0x2d6>;
	};