[PATCH v2 0/2] Stabilize serial line numbers on MediaTek boards
Carlo Caione <[email protected]> Mon, 27 Jul 2026 09:38:07 +0200
| Newsgroups | org.kernel.vger.linux-serial,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260727-ccaione-genio-serial-aliases-v2-0-0f2ae41a8e89@baylibre.com> |
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 <[email protected]> --- 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 <[email protected]>