MarvellEmbeddedProcessors / mainline-public

Other
15 stars 11 forks source link

serial: mvebu-uart: report back changed termios properly #78

Closed 1082008 closed 7 years ago

1082008 commented 7 years ago

This is needed for the termios caller to see the actual baud rate change. Tested on espressobin v5.0.1 board.

Signed-off-by: László ÁSHIN laszlo@ashin.hu

1082008 commented 7 years ago

Hi Miquèl,

I will double check it in several hours. Maybe our kernel configs are different.

miquelraynal commented 7 years ago

Don't spend too much time on that, I have changed the termios handling section and this time I really needed the tty_termios_encode_baud_rate() call anyway.

Thank you for pointing it, Miquèl

1082008 commented 7 years ago

OK, I will run a test with your change and report the results. Thanks!

1082008 commented 7 years ago

@miquelraynal I haven't found the branch with the modification you mentioned.

I tried without tty_termios_encode_baud_rate() but setting baud rate doesn't work:

(I tried to run minicom here...)
root@espressobin:~# stty -F /dev/ttyMV1 
speed 9600 baud; line = 0;
min = 1; time = 5;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
root@espressobin:~# stty -F /dev/ttyMV1 2400
stty: /dev/ttyMV1: unable to perform all requested operations
root@espressobin:~# stty -F /dev/ttyMV1
speed 9600 baud; line = 0;
min = 1; time = 5;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
root@espressobin:~# stty -F /dev/ttyMV1 9600
root@espressobin:~# stty -F /dev/ttyMV1
speed 9600 baud; line = 0;
min = 1; time = 5;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

After applying my patch again:

root@espressobin:~# stty -F /dev/ttyMV1
speed 9600 baud; line = 0;
-brkint -imaxbel
root@espressobin:~# stty -F /dev/ttyMV1 2400
root@espressobin:~# stty -F /dev/ttyMV1
speed 2400 baud; line = 0;
-brkint -imaxbel
root@espressobin:~# stty -F /dev/ttyMV1 9600
root@espressobin:~# stty -F /dev/ttyMV1
speed 9600 baud; line = 0;
-brkint -imaxbel

This is my kernel config: espresso.config.txt

miquelraynal commented 7 years ago

Hi,

I will push on this repository once the series will have been accepted (probably next week).

For now, could you please test on this branch instead ? https://github.com/miquelraynal/linux/commits/marvell/4.14-rc2/a3700-uart2

1082008 commented 7 years ago

That branch works for me. Flashing an arduino through UART2 still not works but I have several ideas to try out.

miquelraynal commented 7 years ago

Cool ! Good luck for your project.

1082008 commented 7 years ago

Thanks. Thank you for your help!