* [PATCH 0/2] serial: pmac_zilog: two receive fixes
@ 2026-10-13 1:35 Tim Douglas
2026-10-13 1:35 ` [PATCH 1/2] serial: pmac_zilog: push received data to the port that received it Tim Douglas
2026-10-13 1:35 ` [PATCH 2/2] serial: pmac_zilog: report received breaks Tim Douglas
0 siblings, 2 replies; 3+ messages in thread
From: Tim Douglas @ 2026-10-13 1:35 UTC (permalink / raw)
To: gregkh, jirislaby
Cc: linux-serial, linuxppc-dev, linux-kernel, maddy, mpe, npiggin,
chleroy, Tim Douglas
These two patches fix receive problems in pmac_zilog that I ran into
while bringing up the serial ports on a Performa 6200CD, a NuBus Power
Macintosh. The first stops data received on one port from being left in
its flip buffer while the other port is open. The second makes received
breaks visible; until now they arrived as plain NUL characters.
I tested both on the 6200, running 7.2.8 with an out-of-tree platform
port and a loopback plug on the printer port. Without the series, only 3
of 8 bytes written to ttyPZ1 came back while ttyPZ0 was open, and a
break sent with tcsendbreak() arrived as a NUL with no break counted.
With the series, all 8 bytes came back, the break was counted, and with
PARMRK set it read as FF 00 00.
The series also builds on v7.3-rc7 with pmac32_defconfig and W=1 without
warnings. I have not tested 68k Macs or macio Power Macs.
I found these bugs and wrote the patches with the help of Claude Opus
5.5. I have reviewed both patches and run the tests on the 6200 myself.
Tim Douglas (2):
serial: pmac_zilog: push received data to the port that received it
serial: pmac_zilog: report received breaks
drivers/tty/serial/pmac_zilog.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
--
2.54.0 (Apple Git-157)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] serial: pmac_zilog: push received data to the port that received it
2026-10-13 1:35 [PATCH 0/2] serial: pmac_zilog: two receive fixes Tim Douglas
@ 2026-10-13 1:35 ` Tim Douglas
2026-10-13 1:35 ` [PATCH 2/2] serial: pmac_zilog: report received breaks Tim Douglas
1 sibling, 0 replies; 3+ messages in thread
From: Tim Douglas @ 2026-10-13 1:35 UTC (permalink / raw)
To: gregkh, jirislaby
Cc: linux-serial, linuxppc-dev, linux-kernel, maddy, mpe, npiggin,
chleroy, Tim Douglas, stable
pmz_interrupt() drains both channels but, since commit 2e124b4a390c
("TTY: switch tty_flip_buffer_push"), pushes the flip buffer of the
port whose handler is running rather than the port that was drained.
With both ports open, data received on the other port can be left in
its flip buffer until something else pushes it, so its reader may not
see it.
Fixes: 2e124b4a390c ("TTY: switch tty_flip_buffer_push")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Tim Douglas <me@timdoug.com>
---
drivers/tty/serial/pmac_zilog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index e3a9193..f49d605 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -444,7 +444,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id)
skip_a:
uart_port_unlock(&uap_a->port);
if (push)
- tty_flip_buffer_push(&uap->port.state->port);
+ tty_flip_buffer_push(&uap_a->port.state->port);
if (!uap_b)
goto out;
@@ -469,7 +469,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id)
skip_b:
uart_port_unlock(&uap_b->port);
if (push)
- tty_flip_buffer_push(&uap->port.state->port);
+ tty_flip_buffer_push(&uap_b->port.state->port);
out:
return rc;
--
2.54.0 (Apple Git-157)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] serial: pmac_zilog: report received breaks
2026-10-13 1:35 [PATCH 0/2] serial: pmac_zilog: two receive fixes Tim Douglas
2026-10-13 1:35 ` [PATCH 1/2] serial: pmac_zilog: push received data to the port that received it Tim Douglas
@ 2026-10-13 1:35 ` Tim Douglas
1 sibling, 0 replies; 3+ messages in thread
From: Tim Douglas @ 2026-10-13 1:35 UTC (permalink / raw)
To: gregkh, jirislaby
Cc: linux-serial, linuxppc-dev, linux-kernel, maddy, mpe, npiggin,
chleroy, Tim Douglas
pmz_status_handle() sets PMACZILOG_FLAG_BREAK from RR0, and
pmz_receive_chars() clears it on the null character that ends the
break without marking that character, then tests BRK_ABRT in RR1,
where the SCC does not set it in asynchronous mode. Breaks therefore
arrive as plain NULs: brk is never counted and BRKINT, PARMRK and SysRq
never see them.
Set BRK_ABRT in r1 for that character, as sunzilog does.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by: LLM
Signed-off-by: Tim Douglas <me@timdoug.com>
---
drivers/tty/serial/pmac_zilog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index f49d605..a612f1d 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -233,6 +233,7 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
ch &= uap->parity_mask;
if (ch == 0 && uap->flags & PMACZILOG_FLAG_BREAK) {
uap->flags &= ~PMACZILOG_FLAG_BREAK;
+ r1 |= BRK_ABRT;
}
#if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_SERIAL_CORE_CONSOLE)
--
2.54.0 (Apple Git-157)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-13 1:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 1:35 [PATCH 0/2] serial: pmac_zilog: two receive fixes Tim Douglas
2026-10-13 1:35 ` [PATCH 1/2] serial: pmac_zilog: push received data to the port that received it Tim Douglas
2026-10-13 1:35 ` [PATCH 2/2] serial: pmac_zilog: report received breaks Tim Douglas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®