Re: [PATCH v5 0/7] Fix transmit handling on SCI/RSCI ports

From: Diogo Ivo

Date: Mon Nov 30 2026 - 05:16:52 EST


Hi all,

On 11/17/2026 11:40 PM, Diogo Ivo wrote:
Hi all,

This is v5 of the SCI/RSCI transmit fixes originally posted by Biju
Das. Patches 1, 5 and 6 retain the v3 code and descriptions from Biju
and Au Dang, patch 2 is updated to address v4 review feedback, and
patches 3, 4 and 7 incorporate additional RSCI fixes.

The series addresses transmit stalls, duplicated output and spurious
interrupts on the SCI (PORT_SCI) and RSCI ports of the sh-sci driver:

- Patch 1 removes the code that disables TE at the end of a
transmission on SCI, which the hardware manual does not describe.
- Patch 2 stops the TEI handler from turning the transmitter off
while hardware or software TX data is still pending, which could
stall or cut off output. It also covers the TE handling that patch 1
no longer does in sci_transmit_chars().
- Patch 3 enables TEIE in rsci_stop_tx() when TE is set, allowing
transmit-end handling to clear TE after the hardware FIFO drains.
- Patch 4 avoids kicking RSCI transmission from the receive-error
handler, which could otherwise cause spurious TEI interrupts or
leave the transmitter in a state that stalls later output.
- Patch 5 skips the software clear of the TDxE flag on SCI, since
hardware clears it on a TDR write and the extra clear caused a
spurious TXI and a duplicated last character.
- Patch 6 forces a TE toggle when restoring SCSCR in the console
write path on SCI, so the TXI that restarts an interrupted drain is
generated. Without it the RZ/G2UL console can hang during boot.
- Patch 7 simplifies rsci_transmit_chars() now that the receive-error
handler no longer invokes it, and reuses rsci_stop_tx().

OpenCode (GPT-6.1 Sol and Gemini 4 Argon) assisted with reviewing the
previous discussion, preparing and reordering this series, updating
trailers and recipients, and drafting this cover letter, as well as
helping debug the various edge cases and proposing code changes.

Changes in v5:
* Patch 2:
- Make the commit message more succinct.
- Drop unused tie and teie initializers from sci_scif_port_params_bits.
- Enable SCSCR.TEIE in sci_stop_tx() on PORT_SCI and call
sci_stop_tx() in sci_transmit_chars() when empty or stopped.
- Check poll_sent_bits in sci_tx_end_interrupt() before acting on TEI.
- Prevent sci_tx_end_interrupt() from restarting TX during suspend.
- Link to v4: https://patch.msgid.link/20261113-g2ul_sci-v4-0-6815e41d90c5@xxxxxxxxxxx

Gentle ping on this series.

Thanks,
Diogo