diff options
| author | Naveen Kumar Chaudhary <[email protected]> | 2026-06-07 21:03:43 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-06-23 12:37:02 -0600 |
| commit | 0bef438428ca0118da2ebb44493d5d2090cb05a2 (patch) | |
| tree | 60ffb83e5df4b98e9acc0b2e437f68404755f228 /scripts/multiconfig.py | |
| parent | 157186fbfc24c54117b41e292a35809a0560b9c0 (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/multiconfig.py')
0 files changed, 0 insertions, 0 deletions
