From: Bernhard Beschow Date: Sat, 11 Jan 2025 18:37:01 +0000 (+0100) Subject: hw/char/imx_serial: Update all state before restarting ageing timer X-Git-Tag: v10.0.0-rc0~76^2~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a451cc11c47903242123def2717a86a56e5fb390;p=thirdparty%2Fqemu.git hw/char/imx_serial: Update all state before restarting ageing timer Fixes characters to be "echoed" after each keystroke rather than after every other since imx_serial_rx_fifo_ageing_timer_restart() would see ~UTS1_RXEMPTY only after every other keystroke. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index cb6761d40e..38b4865157 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -401,14 +401,14 @@ static void imx_put_data(void *opaque, uint32_t value) if (fifo32_num_used(&s->rx_fifo) >= rxtl) { s->usr1 |= USR1_RRDY; } - - imx_serial_rx_fifo_ageing_timer_restart(s); - s->usr2 |= USR2_RDR; s->uts1 &= ~UTS1_RXEMPTY; if (value & URXD_BRK) { s->usr2 |= USR2_BRCD; } + + imx_serial_rx_fifo_ageing_timer_restart(s); + imx_update(s); }