
Eu tenho um dispositivo sama5d36 rodando Debian jessie (kernel 4.1.10) com um DMA USART. Para que o DMA USART produzisse corretamente, tive que desligar o ECHO e o ONLCR.
stty -F /dev/ttyS2 -echo -onlcr speed 115200
Se eu fizer um teste onde envio vários bytes, receberei 2.048 bytes e ele parará de receber até eu reiniciar.
cat testLines > /dev/ttyS2
cat < /dev/ttyS2
Aqui está a saída de /proc/tty/driver/atmel_serial
2: uart:ATMEL_SERIAL mmio:0xF0020000 irq:31 tx:2185 rx:2048 DSR|CD|RI
Aqui está minha saída 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
O buffer DMA para atmel_serial tem 512 bytes.
Alguma ideia?
Atualização: Outras jogadas demonstraram que a série gravará mais de 2.048 bytes, mas congela após 2.048 bytes e só gravará quando 2.048 bytes forem gravados. Olhando para atmel_serial.c no kernel, parece que o buffer de anel está definido para 1024. Portanto, ainda estou confuso por que 2.048 bytes é significativo.
Responder1
Atualize seu kernel para um kernel mais recente. Houve problemas com este driver nos kernels anteriores.