]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
serial: sh-sci: Fix deadlock during RSCI FIFO overrun error
authorBiju Das <biju.das.jz@bp.renesas.com>
Fri, 14 Nov 2025 10:13:47 +0000 (10:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Dec 2025 17:40:19 +0000 (18:40 +0100)
commit 75a9f4c54770f062f4b3813a83667452b326dda3 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: 0666e3fe95ab ("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>
drivers/tty/serial/sh-sci.c

index 62bb62b82cbe582d9c0e83887c6d3e7b7c0e5ddc..1db4af6fe59096de9d8902643e544230b9bdd56f 100644 (file)
@@ -1024,8 +1024,16 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
 
        status = s->ops->read_reg(port, s->params->overrun_reg);
        if (status & s->params->overrun_mask) {
-               status &= ~s->params->overrun_mask;
-               s->ops->write_reg(port, s->params->overrun_reg, status);
+               if (s->type == SCI_PORT_RSCI) {
+                       /*
+                        * All of the CFCLR_*C clearing bits match the corresponding
+                        * CSR_*status bits. So, reuse the overrun mask for clearing.
+                        */
+                       s->ops->clear_SCxSR(port, s->params->overrun_mask);
+               } else {
+                       status &= ~s->params->overrun_mask;
+                       s->ops->write_reg(port, s->params->overrun_reg, status);
+               }
 
                port->icount.overrun++;