From: "Carlo Caione" <ccaione@baylibre.com>
To: "AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Carlo Caione" <ccaione@baylibre.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<linux-serial@vger.kernel.org>, <dlechner@baylibre.com>,
<jstephan@baylibre.com>
Subject: Re: [PATCH v2 1/2] arm64: dts: mediatek: alias all enabled serial ports
Date: Mon, 27 Jul 2026 13:49:06 +0200 [thread overview]
Message-ID: <DK9BWMDFMNK0.K7MAJJAZVKM0@baylibre.com> (raw)
In-Reply-To: <a3298120-f5be-4a8a-bb71-1d6923a28d6c@collabora.com>
On Mon Jul 27, 2026 at 1:30 PM CEST, AngeloGioacchino Del Regno wrote:
> On 7/27/26 09:38, Carlo Caione wrote:
>> On most MediaTek boards only serial0 is aliased, so the remaining
>> enabled uarts get first-free ttyS line numbers from the 8250 core in
>> probe order. When the console uart defers on its clocks another uart can
>> win line 0: console=ttyS0 then ends up on the wrong port and the boot
>> looks like a hang on the serial console, depending on probe order.
>>
>> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
>> ---
>> 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 +
>> 12 files changed, 21 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt6795-sony-xperia-m5.dts b/arch/arm64/boot/dts/mediatek/mt6795-sony-xperia-m5.dts
>> index 0e086dd487d9..63659e240b1d 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt6795-sony-xperia-m5.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt6795-sony-xperia-m5.dts
>> @@ -20,6 +20,7 @@ aliases {
>> mmc2 = &mmc2;
>> serial0 = &uart0;
>> serial1 = &uart1;
>> + serial2 = &uart2;
>> };
>>
>> backlight_lcd0: backlight {
>> diff --git a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
>> index 8c3e2e2578bc..7bccad118d24 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
>> @@ -20,6 +20,7 @@ / {
>>
>> aliases {
>> serial0 = &uart0;
>> + serial2 = &uart2;
>
> Why is that serial2 and not serial1 = &uart2?
To tie the alias number to the SoC uart index instead of to the set of
currently-enabled ports.
The problem is that uart1 exists on mt7622 but is disabled. With serial1
= &uart2, the day uart1 gets enabled the aliases have to be renumbered
and uart2 silently moves from ttyS1 to ttyS2 (or we have to again mix
serial and uart number).
Also in general it keeps ttyS<N> matching the schematics' UART<N>.
Ciao,
--
Carlo Caione
next prev parent reply other threads:[~2026-07-27 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DK9BWMDFMNK0.K7MAJJAZVKM0@baylibre.com \
--to=ccaione@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=jstephan@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox