Skip to content

Cadence UART cleanups and Tx path fixes

Peter Crosthwaite qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 1 replyIn review
  2. v111 patches 2 repliesSuperseded

Changes in v2 from the cover letter

Fixed /*< private >*/ spacing (AF review)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11char/cadence_uart: Mark struct fields as public/privatehw/char/cadence_uart.c+2 -00 replies
2/11char/cadence_uart: Add missing uart_update_statehw/char/cadence_uart.c+1 -00 replies
3/11char/cadence_uart: Fix reset.hw/char/cadence_uart.c+4 -30 replies
4/11char/cadence_uart: s/r_fifo/rx_fifohw/char/cadence_uart.c+4 -40 replies
5/11char/cadence_uart: Simplify status generationhw/char/cadence_uart.c+8 -250 replies
6/11char/cadence_uart: Define Missing SR/ISR fieldshw/char/cadence_uart.c+4 -00 replies
7/11char/cadence_uart: Remove TX timer & add TX FIFO statehw/char/cadence_uart.c+13 -310 replies
8/11char/cadence_uart: Fix can_receive logichw/char/cadence_uart.c+9 -10 replies
9/11char/cadence_uart: Use the TX fifo for transmissionhw/char/cadence_uart.c+16 -10 replies
10/11char/cadence_uart: Delete redundant rx rst logichw/char/cadence_uart.c+0 -20 replies
11/11char/cadence_uart: Implement Tx flow controlhw/char/cadence_uart.c+29 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH target-arm v2 00/11] Cadence UART cleanups and Tx path fixes

When using QEMU in some terminal environments, char back-ends for serial devices can return EAGAIN for non trivial periods. This coupled with use of qemu_chr_fe_write_all() is a leading cause of:

main-loop: WARNING: I/O thread spun for 1000 iterations

This series fixes this for cadence_uart by replacing the open loop tx-write logic with a proper closed-loop that is responsive to the back-end short return.

Various trivial cleanups are at the front of the series. Last patch is the main event.

There is also a major performance increase with removal of the tx timer logic (P7).

As a test, I've been using QEMU in a terminal over trans-pacific SSH. Before this series:

$ time ./qemu-build/arm-softmmu/qemu-system-arm -M xilinx-zynq-a9 ...
main-loop: WARNING: I/O thread spun for 1000 iterations
Booting Linux on physical CPU 0x0
...
PetaLinux v2013.04 (Yocto 1.3) zynq ttyPS0

zynq login: QEMU: Terminated

real    2m26.908s
user    1m41.430s
sys     1m7.116s

And after:

$ time ./qemu-build/arm-softmmu/qemu-system-arm -M xilinx-zynq-a9 ...
Booting Linux on physical CPU 0x0
...
PetaLinux v2013.04 (Yocto 1.3) zynq ttyPS0

zynq login: QEMU: Terminated

real    0m16.149s
user    0m10.357s
sys     0m0.164s

Changed since v1:
Fixed /*< private >*/ spacing (AF review)

Peter Crosthwaite (11):
char/cadence_uart: Mark struct fields as public/private char/cadence_uart: Add missing uart_update_state char/cadence_uart: Fix reset. char/cadence_uart: s/r_fifo/rx_fifo char/cadence_uart: Simplify status generation char/cadence_uart: Define Missing SR/ISR fields char/cadence_uart: Remove TX timer & add TX FIFO state char/cadence_uart: Fix can_receive logic char/cadence_uart: Use the TX fifo for transmission char/cadence_uart: Delete redundant rx rst logic char/cadence_uart: Implement Tx flow control

 hw/char/cadence_uart.c | 153 ++++++++++++++++++++++++++++---------------------
 1 file changed, 87 insertions(+), 66 deletions(-)
Signature · 1 line
1.8.5.2