sh_serial_receive_break() set bit 4 of the status register (sr) instead
of SH_SERIAL_FLAG_BRK (bit 3) in the flags field. The read path checks
flags, not sr, so break events were never visible to the guest.

Fixes: 63242a007a18 ("SH4: Serial controller improvement")
Reported-by: Pavee Hui <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
 hw/char/sh_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 8728842b84e0..8933af24be10 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -322,7 +322,7 @@ static int sh_serial_can_receive(SHSerialState *s)
 static void sh_serial_receive_break(SHSerialState *s)
 {
     if (s->feat & SH_SERIAL_FEAT_SCIF) {
-        s->sr |= (1 << 4);
+        s->flags |= SH_SERIAL_FLAG_BRK;
     }
 }
 

-- 
2.56.0.rc0.29.g47ce80527c56


Reply via email to