Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Stabilize serial line numbers on MediaTek boards
@ 2026-07-27  7:38 Carlo Caione
  2026-07-27  7:38 ` [PATCH v2 1/2] arm64: dts: mediatek: alias all enabled serial ports Carlo Caione
  2026-07-27  7:38 ` [PATCH v2 2/2] serial: 8250_mtk: honor DT serial aliases Carlo Caione
  0 siblings, 2 replies; 7+ messages in thread
From: Carlo Caione @ 2026-07-27  7:38 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, Jiri Slaby
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
	linux-serial, dlechner, jstephan, Carlo Caione

On MediaTek boards typically only serial0 is aliased, so the remaining
enabled UARTs get first-free ttyS line numbers from the 8250 core at
probe time. Line numbers are handed out in probe order, and probe order
is not deterministic once a UART defers on its clocks, so the console
UART can lose ttyS0 to another port.

This was observed on the Genio 700 EVK running the Ubuntu 26.04 generic
kernel: uart0 (the debug console) deferred waiting for its clocks while
uart1 probed first and claimed ttyS0. With console=ttyS0 on the kernel
command line the console then pointed at the wrong UART, and the boot
looked like it had hung on the serial console. The failure is
intermittent and depends purely on probe timing.

Pin the line numbers explicitly instead:

- Patch 1 aliases every enabled UART on the affected Mediatek boards, so
  DT expresses the intended serial<N> -> ttyS<N> mapping.

- Patch 2 makes the 8250_mtk driver read that alias with
  of_alias_get_id() and seed uart.port.line before registering the
  port, so the 8250 core reserves the requested ttyS slot instead of
  falling back to first-free.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
Changes in v2:
- Added some missing MTK boards
- Link to v1: https://patch.msgid.link/20260708-ccaione-genio-serial-aliases-v1-0-bf22229e9383@baylibre.com

---
Carlo Caione (2):
      arm64: dts: mediatek: alias all enabled serial ports
      serial: 8250_mtk: honor DT serial aliases

 arch/arm64/boot/dts/mediatek/mt6795-sony-xperia-m5.dts    | 1 +
 arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts              | 1 +
 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts  | 2 ++
 arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts              | 2 ++
 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi            | 1 +
 arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts | 4 ++++
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts              | 1 +
 arch/arm64/boot/dts/mediatek/mt8365-evk.dts               | 2 ++
 arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi     | 2 ++
 arch/arm64/boot/dts/mediatek/mt8390-grinn-genio-sbc.dtsi  | 2 ++
 arch/arm64/boot/dts/mediatek/mt8390-tungsten-smarc.dtsi   | 2 ++
 arch/arm64/boot/dts/mediatek/mt8395-genio-common.dtsi     | 1 +
 drivers/tty/serial/8250/8250_mtk.c                        | 7 ++++++-
 13 files changed, 27 insertions(+), 1 deletion(-)
---
base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff
change-id: 20260708-ccaione-genio-serial-aliases-e5f2c28b5ff6

Best regards,
--  
Carlo Caione <ccaione@baylibre.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-27 11:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27  7:38 [PATCH v2 0/2] Stabilize serial line numbers on MediaTek boards Carlo Caione
2026-07-27  7:38 ` [PATCH v2 1/2] arm64: dts: mediatek: alias all enabled serial ports Carlo Caione
2026-07-27  9:49   ` Chen-Yu Tsai
2026-07-27 11:30   ` AngeloGioacchino Del Regno
2026-07-27 11:49     ` Carlo Caione
2026-07-27  7:38 ` [PATCH v2 2/2] serial: 8250_mtk: honor DT serial aliases Carlo Caione
2026-07-27  9:39   ` Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox