This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM6548: UART crash

Part Number: AM6548

Tool/software: Linux

Dear Ti

when the SDK6.0 release, uart has enable the uart DMA function.

I have done the test on the EVM board,But when send huge data to the board,the board can not receive correctly.

the error info:

root@am65xx-evm:~# [ 6488.741391] rcu: INFO: rcu_preempt self-detected stall on CPU
[ 6488.747153] rcu:     0-....: (5250 ticks this GP) idle=8da/1/0x4000000000000004 softirq=30313/30313 fqs=2278
[ 6488.749384] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
[ 6488.756787] rcu:      (t=5253 jiffies g=59941 q=1447)
[ 6488.767481] Task dump for CPU 0:
[ 6488.767490] rcu:     0-....: (5264 ticks this GP) idle=8da/1/0x4000000000000004 softirq=30300/30313 fqs=2298
[ 6488.767495] rcu:
[ 6488.770715] uart_loopback   R
[ 6488.780346] (detected by 2, t=5259 jiffies, g=3713, q=1)
[ 6488.782347]   running task
[ 6488.785306] Task dump for CPU 0:
[ 6488.790604]     0  1297   1038 0x00000002
[ 6488.793646] uart_loopback   R
[ 6488.796863] Call trace:
[ 6488.800858]   running task
[ 6488.803832]  dump_backtrace+0x0/0x158
[ 6488.806255]     0  1297   1038 0x00000002
[ 6488.809302]  show_stack+0x14/0x20
[ 6488.812948] Call trace:
[ 6488.816952]  sched_show_task+0x13c/0x168
[ 6488.820262]  __switch_to+0x94/0xd0
[ 6488.822692]  dump_cpu_task+0x40/0x50
[ 6488.826605]  lock_timer_base+0x60/0xc0
[ 6488.829996]  rcu_dump_cpu_stacks+0x90/0xcc
[ 6488.833556]  try_to_del_timer_sync+0x2c/0x88
[ 6488.837294]  rcu_check_callbacks+0x6c8/0x850
[ 6488.841377]  del_timer_sync+0x44/0x58
[ 6488.845637]  update_process_times+0x2c/0x70
[ 6488.849895]  schedule_timeout+0x1a0/0x338
[ 6488.853546]  tick_sched_handle.isra.5+0x3c/0x48
[ 6488.857713]  wait_for_common+0x140/0x168
[ 6488.861711]  tick_sched_timer+0x48/0x98
[ 6488.866225]            (null)
[ 6488.870138]  __hrtimer_run_queues+0x118/0x1a8
[ 6488.881261]  hrtimer_interrupt+0xe4/0x240
[ 6488.885264]  arch_timer_handler_phys+0x2c/0x38
[ 6488.889701]  handle_percpu_devid_irq+0x80/0x138
[ 6488.894222]  generic_handle_irq+0x24/0x38
[ 6488.898222]  __handle_domain_irq+0x60/0xb8
[ 6488.902308]  gic_handle_irq+0x7c/0x178
[ 6488.906048]  el1_irq+0xb0/0x128
[ 6488.909181]  __do_softirq+0x94/0x208
[ 6488.912750]  irq_exit+0xb8/0xc8
[ 6488.915883]  __handle_domain_irq+0x64/0xb8
[ 6488.919969]  gic_handle_irq+0x7c/0x178
[ 6488.923709]  el1_irq+0xb0/0x128
[ 6488.926846]  mem_serial_out+0xc/0x20
[ 6488.930415]  serial8250_startup+0x14/0x28
[ 6488.934417]  uart_startup.part.9+0x150/0x258
[ 6488.938677]  uart_port_activate+0x4c/0x60
[ 6488.942680]  tty_port_open+0x84/0xd8
[ 6488.946247]  uart_open+0x34/0x48
[ 6488.949468]  tty_open+0xfc/0x3e0
[ 6488.952691]  chrdev_open+0xa4/0x1a0
[ 6488.956174]  do_dentry_open+0x110/0x340
[ 6488.960003]  vfs_open+0x28/0x30
[ 6488.963138]  path_openat+0x268/0x1000
[ 6488.966792]  do_filp_open+0x78/0xf0
[ 6488.970274]  do_sys_open+0x170/0x210
[ 6488.973841]  __arm64_sys_openat+0x20/0x28
[ 6488.977843]  el0_svc_common+0x84/0xf0
[ 6488.981497]  el0_svc_handler+0x2c/0x80
[ 6488.985237]  el0_svc+0x8/0xc

  • Hi,

    Can you please describe the test you did on the AM65x EVM so I can replicate the issue on my side?

  • Dear Liu

    Actually,not only receive but also send function has the problem.

    using the EVM send 40000 bytes to other devices every 5s,the other devices would not receive the data fully.

    EVM board can not receive data correctly reproduce steps:

    1. using the uart debug assistant send 40000 bytes every 5s,

    2.EVM board try to receive the bytes.

    then the evm board would show the ERROR info.

  • Hi,

    Which UART port do you use?

    What are the termios settings in your test?

    What is the UART device on the other end? a PC?

  • Hi

    1. ttyS1.

    2.there is no other strange settings.

     Just set the baud rate to the 115200.

    3. PC

  • Hi,

    I don't have a Windows PC setup to test with Uart Debug Assistant, and I tested the EVM ttyS1 with a Linux PC using the tool from the link below.

    https://github.com/cbrake/linux-serial-test.git

    But I don't see such kernel crash in either RX or TX test with baud rate 115200.

    Please also try with the following DMA patch.

    From 24a2799c010ef76bfacb6336428809c1b4b9e787 Mon Sep 17 00:00:00 2001
    From: Peter Ujfalusi <peter.ujfalusi@ti.com>
    Date: Fri, 19 Jul 2019 16:13:48 +0300
    Subject: [PATCH] dmaengine: ti: k3-udma: Fix wrong of_node_put() usage on
     slave_node
    
    of_find_node_by_name(from, name) does pf_node_put() on from so we should
    not call it anymore.
    Move the psil-base reading earlier before the slave_node is put back.
    
    Reported-by: Bin Liu <b-liu@ti.com>
    Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
    ---
     drivers/dma/ti/k3-udma.c | 20 +++++++++-----------
     1 file changed, 9 insertions(+), 11 deletions(-)
    
    diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
    index 8c1a72c4abef..a6c7b8797b9d 100644
    --- a/drivers/dma/ti/k3-udma.c
    +++ b/drivers/dma/ti/k3-udma.c
    @@ -2976,11 +2976,19 @@ static bool udma_dma_filter_fn(struct dma_chan *chan, void *param)
     		return false;
     	}
     
    +	if (of_property_read_u32(slave_node, "ti,psil-base", &val)) {
    +		dev_err(ud->dev, "ti,psil-base is missing\n");
    +		return false;
    +	}
    +
    +	uc->remote_thread_id = val + args[1];
    +
     	snprintf(prop, sizeof(prop), "ti,psil-config%u", args[1]);
    +	/* Does of_node_put on slave_node */
     	chconf_node = of_find_node_by_name(slave_node, prop);
     	if (!chconf_node) {
     		dev_err(ud->dev, "Channel configuration node is missing\n");
    -		of_node_put(slave_node);
    +		uc->remote_thread_id = -1;
     		return false;
     	}
     
    @@ -3007,16 +3015,6 @@ static bool udma_dma_filter_fn(struct dma_chan *chan, void *param)
     
     	of_node_put(chconf_node);
     
    -	if (of_property_read_u32(slave_node, "ti,psil-base", &val)) {
    -		dev_err(ud->dev, "ti,psil-base is missing\n");
    -		of_node_put(slave_node);
    -		return false;
    -	}
    -
    -	uc->remote_thread_id = val + args[1];
    -
    -	of_node_put(slave_node);
    -
     	dev_dbg(ud->dev, "chan%d: Remote thread: 0x%04x (%s)\n", uc->id,
     		uc->remote_thread_id, udma_get_dir_text(uc->dir));
     
    -- 
    2.17.1
    
    

    By tht way, do you route the ttyS1 port to the Header J30 or the FTDI port?