From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Claudiu <claudiu.beznea@tuxon.dev>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.10.y 1/4] serial: sh-sci: Check if TX data was written to device in .tx_empty()
Date: Tue, 3 Jun 2025 15:04:07 -0400 [thread overview]
Message-ID: <20250603141944-f59cbd63bc5624d8@stable.kernel.org> (raw)
In-Reply-To: <20250603093701.3928327-2-claudiu.beznea.uj@bp.renesas.com>
[ 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: Claudiu<claudiu.beznea@tuxon.dev>
Commit author: Claudiu Beznea<claudiu.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.renesas.com
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 |
next prev parent reply other threads:[~2025-06-03 19:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 9:36 [PATCH 5.10.y 0/4] serial: sh-sci: Backport fixes Claudiu
2025-06-03 9:36 ` [PATCH 5.10.y 1/4] serial: sh-sci: Check if TX data was written to device in .tx_empty() Claudiu
2025-06-03 19:04 ` Sasha Levin [this message]
2025-06-04 13:27 ` Greg KH
2025-06-03 9:36 ` [PATCH 5.10.y 2/4] serial: sh-sci: Move runtime PM enable to sci_probe_single() Claudiu
2025-06-03 18:36 ` Sasha Levin
2025-06-03 9:37 ` [PATCH 5.10.y 3/4] serial: sh-sci: Clean sci_ports[0] after at earlycon exit Claudiu
2025-06-03 18:35 ` Sasha Levin
2025-06-03 9:37 ` [PATCH 5.10.y 4/4] serial: sh-sci: Increment the runtime usage counter for the earlycon device Claudiu
2025-06-03 18:36 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250603141944-f59cbd63bc5624d8@stable.kernel.org \
--to=sashal@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.