summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNaveen Kumar Chaudhary <[email protected]>2026-06-07 21:03:43 +0530
committerTom Rini <[email protected]>2026-06-23 12:37:02 -0600
commit0bef438428ca0118da2ebb44493d5d2090cb05a2 (patch)
tree60ffb83e5df4b98e9acc0b2e437f68404755f228 /scripts
parent157186fbfc24c54117b41e292a35809a0560b9c0 (diff)
serial: cortina: check RX FIFO status before reading data
ca_serial_getc() reads from the URX_DATA register unconditionally without first checking whether the RX FIFO contains valid data. When the FIFO is empty, this returns whatever stale value is in the register, which the DM serial framework interprets as a valid character. The DM serial framework expects getc() to return -EAGAIN when no data is available, so it can handle retries and call schedule() to service the watchdog between attempts. Add a check of the UINFO register's UINFO_RX_FIFO_EMPTY bit before reading URX_DATA, returning -EAGAIN when no data is pending. This is consistent with how ca_serial_putc() already checks UINFO_TX_FIFO_FULL before writing. Signed-off-by: Naveen Kumar Chaudhary <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions