@JP-Norair I'm still wondering what could be the difference between your Omega2 setup and mine.
Because in my current project (means: I heavily using the code every day), I am using
poll() all the time. I also found that the library I'm using even occasionaly uses
tcflush(TCIFLUSH) and tcflush(TCIOFLUSH) - I thought it didn't, in my previous post.
The read code is simple, when
poll() returns a POLLIN, a single
read() reads everything currently available.
tcflush() is used only after detecting receiving errors (unexpected message lengths, crc errors).
What kernel, musl and openwrt version are you using?
My versions are linux 4.14.95, musl 1.1.19 and openwrt 18.06.2
All openwrt v18.06.x use musl 1.1.19. LEDE v17.01 was using musl 1.1.16, upcoming openwrt v19.07 will use musl 1.1.23, but I found no commit in musl since 1.1.19 I could relate to anything fixed regarding serial ports.
From the fact that @Lazar-Demin confirms the use of the standard 8250 driver, and the MIPS platform is not an obscure corner case for linux, I would agree that the problem is more likely a musl thing.