Skip to content

[qcom-next] serial: msm_geni: validate RX data with IRQ status - #88

Merged
Gopinath Sekar (g-sekar) merged 2 commits into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:uart_fix_qn
Sep 13, 2026
Merged

Gopinath Sekar (g-sekar) merged 2 commits into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:uart_fix_qn

Conversation

@balajiselvanathan

Copy link
Copy Markdown

The GENI UART hardware can retain stale data in the RX FIFO. The msm_serial_pending() function was reporting this stale data as pending input, causing U-Boot to incorrectly assume a key press and stop at the CLI prompt instead of continuing the boot process.

Add IRQ status validation to distinguish between legitimate received data and stale FIFO contents. Check the Secondary IRQ status register for RX watermark or last flags before reporting pending data. If the FIFO contains data but no valid IRQ flags are set, ignore it as stale.

Upstream link: https://lore.kernel.org/u-boot/20260629-uart-v1-1-cbc46fe1d7d3@oss.qualcomm.com/

@b49020

Copy link
Copy Markdown
Member

I see this commit getting a NAK upstream, please incorporate upstream feedback.

@balajiselvanathan

Copy link
Copy Markdown
Author

I see this commit getting a NAK upstream, please incorporate upstream feedback.

addressed Casey' comments and pushed v2: https://lore.kernel.org/u-boot/20260707-uart-v2-0-d38277b6c4ce@oss.qualcomm.com/

Replace the abort-only RX initialization with a proper stop sequence
that matches the Linux driver approach. The new
qcom_geni_serial_stop_rx_fifo function sends a CANCEL command instead
of immediately aborting, waits for completion, drains any remaining
FIFO data if S_RX_FIFO_LAST_EN is set, and only sends ABORT as a
fallback if the secondary sequencer remains active after cancellation.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
…lags

Add IRQ status validation to distinguish legitimate UART data from
electrical noise in the RX FIFO.

When the UART cable is disconnected, the floating RX line can pick up
noise that the GENI hardware interprets as valid data and places in
the FIFO. So, check the RX IRQ status register for RX watermark or last
flags before reporting pending data.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
@g-sekar

Copy link
Copy Markdown

Will merge this change since it is required for release and considering as workarond.
Still there is a NACK, please work on addressing the upstream comments.
This change will be dropped during next rebase if not addressed properly.

@g-sekar Gopinath Sekar (g-sekar) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved Conditionally

@g-sekar
Gopinath Sekar (g-sekar) merged commit 5ec66cb into qualcomm-linux:qcom-next Sep 13, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants