Skip to content

Commit 75a9f4c

Browse files
bijudasgregkh
authored andcommitted
serial: sh-sci: Fix deadlock during RSCI FIFO overrun error
On RSCI IP, a deadlock occurs during a FIFO overrun error, as it uses a different register to clear the FIFO overrun error status. Cc: stable@kernel.org Fixes: 0666e3f ("serial: sh-sci: Add support for RZ/T2H SCI") Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20251114101350.106699-3-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a6cdfd6 commit 75a9f4c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/tty/serial/sh-sci.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,8 +1198,16 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
11981198

11991199
status = s->ops->read_reg(port, s->params->overrun_reg);
12001200
if (status & s->params->overrun_mask) {
1201-
status &= ~s->params->overrun_mask;
1202-
s->ops->write_reg(port, s->params->overrun_reg, status);
1201+
if (s->type == SCI_PORT_RSCI) {
1202+
/*
1203+
* All of the CFCLR_*C clearing bits match the corresponding
1204+
* CSR_*status bits. So, reuse the overrun mask for clearing.
1205+
*/
1206+
s->ops->clear_SCxSR(port, s->params->overrun_mask);
1207+
} else {
1208+
status &= ~s->params->overrun_mask;
1209+
s->ops->write_reg(port, s->params->overrun_reg, status);
1210+
}
12031211

12041212
port->icount.overrun++;
12051213

0 commit comments

Comments
 (0)