Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] Stabilize serial line numbers on MediaTek Genio boards
@ 2026-07-08 11:17 Carlo Caione
  2026-07-08 11:17 ` [PATCH 1/2] arm64: dts: mediatek: alias all enabled serial ports on " Carlo Caione
  2026-07-08 11:17 ` [PATCH 2/2] serial: 8250_mtk: honor DT serial aliases Carlo Caione
  0 siblings, 2 replies; 7+ messages in thread
From: Carlo Caione @ 2026-07-08 11:17 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 the MediaTek Genio boards only serial0 is aliased in DT, so every
other enabled UART gets a first-free ttyS line number 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 Genio boards
   (mt8365-evk, the mt8390 and mt8395 Genio commons, and the Grinn
   Genio SBC), 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>
---
Carlo Caione (2):
      arm64: dts: mediatek: alias all enabled serial ports on Genio boards
      serial: 8250_mtk: honor DT serial aliases

 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/mt8395-genio-common.dtsi    | 1 +
 drivers/tty/serial/8250/8250_mtk.c                       | 7 ++++++-
 5 files changed, 13 insertions(+), 1 deletion(-)
---
base-commit: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
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-08 12:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 11:17 [PATCH 0/2] Stabilize serial line numbers on MediaTek Genio boards Carlo Caione
2026-07-08 11:17 ` [PATCH 1/2] arm64: dts: mediatek: alias all enabled serial ports on " Carlo Caione
2026-07-08 11:27   ` sashiko-bot
2026-07-08 12:58     ` Carlo Caione
2026-07-08 11:17 ` [PATCH 2/2] serial: 8250_mtk: honor DT serial aliases Carlo Caione
2026-07-08 11:26   ` sashiko-bot
2026-07-08 12:54     ` Carlo Caione

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