Skip to content

Commit 75df533

Browse files
bijudasgregkh
authored andcommitted
serial: sh-sci: Fix deadlock during RSCI FIFO overrun error
commit 75a9f4c upstream. 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 774ac59 commit 75df533

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
@@ -1024,8 +1024,16 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
10241024

10251025
status = s->ops->read_reg(port, s->params->overrun_reg);
10261026
if (status & s->params->overrun_mask) {
1027-
status &= ~s->params->overrun_mask;
1028-
s->ops->write_reg(port, s->params->overrun_reg, status);
1027+
if (s->type == SCI_PORT_RSCI) {
1028+
/*
1029+
* All of the CFCLR_*C clearing bits match the corresponding
1030+
* CSR_*status bits. So, reuse the overrun mask for clearing.
1031+
*/
1032+
s->ops->clear_SCxSR(port, s->params->overrun_mask);
1033+
} else {
1034+
status &= ~s->params->overrun_mask;
1035+
s->ops->write_reg(port, s->params->overrun_reg, status);
1036+
}
10291037

10301038
port->icount.overrun++;
10311039

0 commit comments

Comments
 (0)