[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 7cc0e0a43a91052477c2921f924a37d9c3891f0c
WARNING: Author mismatch between patch and upstream commit: Backport author: Claudiuclaudiu.beznea@tuxon.dev Commit author: Claudiu Bezneaclaudiu.beznea.uj@bp.renesas.com
Status in newer kernel trees: 6.15.y | Present (exact SHA1) 6.14.y | Present (exact SHA1) 6.12.y | Present (different SHA1: 7415bc5198ef) 6.6.y | Not found 6.1.y | Not found 5.15.y | Not found
Note: The patch differs from the upstream commit: --- 1: 7cc0e0a43a910 ! 1: 41467f9d0eef9 serial: sh-sci: Check if TX data was written to device in .tx_empty() @@ Metadata ## Commit message ## serial: sh-sci: Check if TX data was written to device in .tx_empty()
+ commit 7cc0e0a43a91052477c2921f924a37d9c3891f0c upstream. + On the Renesas RZ/G3S, when doing suspend to RAM, the uart_suspend_port() is called. The uart_suspend_port() calls 3 times the struct uart_port::ops::tx_empty() before shutting down the port. @@ Commit message Signed-off-by: Claudiu Beznea claudiu.beznea.uj@bp.renesas.com Link: https://lore.kernel.org/r/20241125115856.513642-1-claudiu.beznea.uj@bp.renes... Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org + [claudiu.beznea: fixed conflict by: + - keeping serial_port_out() instead of sci_port_out() in + sci_transmit_chars() + - keeping !uart_circ_empty(xmit) condition in sci_dma_tx_complete(), + after s->tx_occurred = true; assignement] + Signed-off-by: Claudiu Beznea claudiu.beznea.uj@bp.renesas.com
## drivers/tty/serial/sh-sci.c ## @@ drivers/tty/serial/sh-sci.c: struct sci_port { @@ drivers/tty/serial/sh-sci.c: struct sci_port { #define SCI_NPORTS CONFIG_SERIAL_SH_SCI_NR_UARTS @@ drivers/tty/serial/sh-sci.c: static void sci_transmit_chars(struct uart_port *port) { - struct tty_port *tport = &port->state->port; + struct circ_buf *xmit = &port->state->xmit; unsigned int stopped = uart_tx_stopped(port); + struct sci_port *s = to_sci_port(port); unsigned short status; @@ drivers/tty/serial/sh-sci.c: static void sci_transmit_chars(struct uart_port *po @@ drivers/tty/serial/sh-sci.c: static void sci_transmit_chars(struct uart_port *port) }
- sci_serial_out(port, SCxTDR, c); + serial_port_out(port, SCxTDR, c); + s->tx_occurred = true;
port->icount.tx++; } while (--count > 0); @@ drivers/tty/serial/sh-sci.c: static void sci_dma_tx_complete(void *arg) - if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS) + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port);
+ s->tx_occurred = true; + - if (!kfifo_is_empty(&tport->xmit_fifo)) { + if (!uart_circ_empty(xmit)) { s->cookie_tx = 0; schedule_work(&s->work_tx); @@ drivers/tty/serial/sh-sci.c: static void sci_flush_buffer(struct uart_port *port) @@ drivers/tty/serial/sh-sci.c: static inline void sci_free_dma(struct uart_port *p
@@ drivers/tty/serial/sh-sci.c: static unsigned int sci_tx_empty(struct uart_port *port) { - unsigned short status = sci_serial_in(port, SCxSR); + unsigned short status = serial_port_in(port, SCxSR); unsigned short in_tx_fifo = sci_txfill(port); + struct sci_port *s = to_sci_port(port); + ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-5.10.y | Success | Success |