[PATCH v4 0/2] serial: amba-pl011: fix RS485 state on enable and reconfiguration

From: Nicolai Buchwitz

Date: Wed Oct 21 2026 - 07:51:44 EST


More RS485 fixes for pl011, on top of the ones already in tty-next.
Together they are the groundwork for a series I plan to send next
cycle, which refactors the RS485 code for better performance and
reliability.

Both patches fix changing the RS485 settings while data is going out.
Patch 1 keeps the transceiver from driving the bus after the data is
out when RS485 is enabled mid-transmission. Patch 2 keeps a
reconfiguration from stalling the port.

Tested on a Raspberry Pi CM4 (PL011 on BCM2711) and a CM5 (PL011 on
RP1, behind PCIe on BCM2712).

Deliberately left for follow-ups:
- pl011_rs485_config() sees the old settings, which are only stored
after it returns. Will be fixed in the RS485 rework.
- A TX flush during DMA leaves the bus driven. Will be fixed by a
separate patch sent alongside.

---
Changes in v4:
- Patch 1: detect a running transmission from PIO or DMA activity, not
from queued data (sashiko)
- Link to v3: https://patch.msgid.link/20261019-devel-nbuchwitz-pl011-rs485-reconfig-stall-v3-0-072a9c82ea5e@xxxxxxxxxxx

Changes in v3:
- Patch 1: adopt an active break when resuming (sashiko)
- Link to v2: https://patch.msgid.link/20261017-devel-nbuchwitz-pl011-rs485-reconfig-stall-v2-0-6f457a1ee527@xxxxxxxxxxx

Changes in v2:
- Patch 1: only resume on an open port (sashiko)
- Patch 1: handle stopped output and pause DMA first
- Link to v1: https://patch.msgid.link/20261016-devel-nbuchwitz-pl011-rs485-reconfig-stall-v1-0-f07d4da714be@xxxxxxxxxxx

To: Russell King <linux@xxxxxxxxxxxxxxx>
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
To: Jiri Slaby <jirislaby@xxxxxxxxxx>
To: Nicolai Buchwitz <nb@xxxxxxxxxxx>
To: Lino Sanfilippo <LinoSanfilippo@xxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-serial@xxxxxxxxxxxxxxx

---
Nicolai Buchwitz (2):
serial: amba-pl011: finish a transmission still running when RS485 is enabled
serial: amba-pl011: keep RS485 transmission running on reconfiguration

drivers/tty/serial/amba-pl011.c | 64 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 62 insertions(+), 2 deletions(-)
---
base-commit: 1184f87e2790e8af9be3116f608d2e86b4792d7d
change-id: 20261016-devel-nbuchwitz-pl011-rs485-reconfig-stall-f4fe437cccae

Best regards,
--
Nicolai Buchwitz <nb@xxxxxxxxxxx>