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.

[参考译文] AM5749:TTY 串行8250 OMAP 驱动程序崩溃

Guru**** 655270 points
Other Parts Discussed in Thread: AM5749
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1074192/am5749-tty-serial-8250-omap-driver-crash

部件号:AM5749
“线程: 测试”中讨论的其它部件

您好,

使用由 TIDK 6.03提供的 Linux 内核4.19-RT,我能够使用连接到 AM5749设备(自定义板) uart4的 GPS 设备。
作为基本测试,我使用 gpsscat,gpsmon 或 gpssctl 打开/dev/gnss0接口。

注:UART 4不使用 RTS/CTS 信号,只有 Tx 和 Rx 在 pinmux 项目(SW 流控制)中定义。

现在我正在使用来自 ti-Linux 分支[1]的内核 v5.10.87-rt59,但我在打开/dev/gnss0时注意到内核崩溃:

__irq_svc from mem_serial_in+0x4/0x1c
mem_serial_in from omap8250_set_mctrl+0x38/0xa0
omap8250_set_mctrl from uart_update_mctrl+0x4c/0x58
uart_update_mctrl from uart_dtr_rts+0x60/0xa8
uart_dtr_rts from tty_port_block_til_ready+0xd0/0x2a8
tty_port_block_til_ready from uart_open+0x14/0x1c
uart_open from ttyport_open+0x64/0x148
ttyport_open from serdev_device_open+0x28/0xb0
serdev_device_open from gnss_serial_open+0x14/0x98
gnss_serial_open from gnss_open+0x68/0xb4
gnss_open from chrdev_open+0xa8/0x1a0
chrdev_open from do_dentry_open+0x110/0x3ec
do_dentry_open from path_openat+0xb64/0xd6c
path_openat from do_filp_open+0x80/0xf4
do_filp_open from do_sys_openat2+0x304/0x3d8
do_sys_openat2 from do_sys_open+0x7c/0xcc
do_sys_open from ret_fast_syscall+0x0/0x4c

它不是100%可重现的,但如果您尝试使用同一个命令10次,内核将崩溃。

驱动程序似乎无法从 omap8250_set_mctrl()读取 UART_LCR 寄存器:

"LCR = serial_in(up,UART_LCR);"

PC 处于 mem_serial_in_0x2C/0x30
LR 位于 omap8250_set_mctrl+0x48/0x0xb0

问题仅发生在-RT 内核上,我尝试了几个内核版本:5.10,5.15和5.17。

标准内核不会崩溃。

今天,我又用4.19-RT 内核进行了测试,但我没有重现这一问题。 

[1] https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-5.10.y&id=892cf512e34e60123e043f88bbb80b95141ebe55

此致,
罗曼