From e4ee8ec00253af2fb25437cd4222ace86fe2b4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sun, 4 Oct 2026 14:23:52 +0400 Subject: [PATCH] hw/char/sh_serial: fix break detection flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Marc-André Lureau Reviewed-by: Yoshinori Sato Message-ID: <20261004-issue-4560-v1-38-ccbef537cbeb@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- 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 8728842b84..8933af24be 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; } }