It is not possible to read data from serial port when input buffer contains exactly 9 bytes. The following code demonstrates the issue:
The number 9 is related to the length of the rx_fifo_trig in drivers/tty/serial/imx.c. For kernel 5.4.70, it was possible to set this value to 1 in the device tree, but for kernel 5.15.148, this didn't work for me anymore. The new work-around was to disable dma using the "no-dma" setting in device tree. Anyway, this seems like a bug in the serial port implementation which should be fixed.