[PATCH v2 03/13] hw/char/imx_serial: Update all state before restarting ageing timer

Bernhard Beschow posted 13 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH v2 03/13] hw/char/imx_serial: Update all state before restarting ageing timer
Posted by Bernhard Beschow 2 months, 3 weeks ago
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 <shentey@gmail.com>
---
 hw/char/imx_serial.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index f805da23ff..be06f39a4d 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -381,14 +381,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);
 }
 
-- 
2.48.0
Re: [PATCH v2 03/13] hw/char/imx_serial: Update all state before restarting ageing timer
Posted by Peter Maydell 2 months, 1 week ago
On Sat, 11 Jan 2025 at 18:37, Bernhard Beschow <shentey@gmail.com> wrote:
>
> 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 <shentey@gmail.com>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM