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: [email protected]
Assisted-by: LLM
Signed-off-by: Tim Douglas <[email protected]>
---
 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)


Reply via email to