串行 DMA 在 2048 字节后暂停

串行 DMA 在 2048 字节后暂停

我有一个 sama5d36 设备,运行 Debian jessie(内核 4.1.10),带有 DMA USART。为了让 DMA USART 正确输出,我必须关闭 ECHO 和 ONLCR。

stty -F /dev/ttyS2 -echo -onlcr speed 115200

如果我进行测试,发送一堆字节,我将收到 2048 个字节,然后它会停止接收,直到我重新启动。

cat testLines > /dev/ttyS2
cat < /dev/ttyS2

这是 /proc/tty/driver/atmel_serial 的输出

2: uart:ATMEL_SERIAL mmio:0xF0020000 irq:31 tx:2185 rx:2048 DSR|CD|RI

这是我的 stty 输出(stty -F /dev/ttyS2 -a):

atmel_usart f0020000.serial: using dma0chan4 for rx DMA transfers
atmel_usart f0020000.serial: using dma0chan5 for tx DMA transfers
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

atmel_serial 的 DMA 缓冲区为 512 字节。

有什么见解吗?

更新:进一步播放表明,串口将写入超过2048字节,但在2048字节后冻结,然后仅写入一次2048字节。查看内核中的 atmel_serial.c,看起来环形缓冲区设置为 1024。所以我仍然很困惑为什么 2048 字节很重要。

答案1

将您的内核升级到较新的内核。该驱动程序在早期内核中存在问题。

相关内容