andy-shev / linux

Linux kernel source tree
Other
25 stars 11 forks source link

Another variant of transmit using sgl #37

Closed htot closed 1 year ago

htot commented 2 years ago

Can you please have a look at e3ffdfaf0eafb7040f75659b1dcc16e5e798cbf0?

It is based on https://elixir.bootlin.com/linux/latest/source/drivers/tty/serial/imx.c#L643 and behaves exactly the same way as the version ce7c0cd9860eabb2353e8c2330ff253333b61028 you already took.

I think it looks cleaner but probably has more overhead.

The main thing I'm busting my brain on is, when I use my hs_serial program to test serial communication it works fine. But when I setup pppd between 2 Edisons and test using iperf3 it hangs very quickly:

root@yuna:~# iperf3 -c 192.168.5.101 --bidir -t 0
Connecting to host 192.168.5.101, port 5201
[  6] local 192.168.5.100 port 53684 connected to 192.168.5.101 port 5201
[  8] local 192.168.5.100 port 53686 connected to 192.168.5.101 port 5201
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd
[  6][TX-C]   0.00-1.00   sec   107 KBytes   879 Kbits/sec    2   1.41 KBytes       
[  8][RX-C]   0.00-1.00   sec  24.0 KBytes   197 Kbits/sec                  
[  6][TX-C]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec    2   1.41 KBytes       
[  8][RX-C]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec                  
....

I hangs so badly that the only way to get serial working again is to reboot. I think (but not sure) that dma->tx_running is never cleared in a particular case, but I don't know how it's triggered by pppd.

When I do exactly the same without sgl but using a bounce buffer https://github.com/andy-shev/linux/pull/29/files pppd / iperf3 works just fine.

andy-shev commented 1 year ago

I guess it's outdated and still problematic. I believe if we have a solution it should be in upstream. Hence closing this PR.

htot commented 1 year ago

It worked, but due to later driver changes failed to apply. After shoehorning it appeared to be broken. As this this was the "another variant" I didn't find the time to fix it good. So agreed to close.