I have a sensor connected to /dev/ttymxc2 and this works fine with kernel 4.1.15. After upgrading to kernel 5.4.70, the communication stops working. The sensor uses a binary protocol with request and reply. After the upgrade, some of the replies from the sensor are lost, but some are still received. This is consistent. Certain commands always work and others never work. Typical for commands that doesn't work is that the delay before response is higher, 20-30ms.
I've verified with an oscilloscope that the sensor sends the response.
I use pyserial, but I've also verified the issue using stty and dd.
Is there any reason why serial communication behaves differently in the two kernel versions? Kernel configuration and devicetree is unchanged.