From: sashiko-bot@kernel.org
To: "Carlo Caione" <ccaione@baylibre.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/2] serial: 8250_mtk: honor DT serial aliases
Date: Wed, 08 Jul 2026 11:26:02 +0000 [thread overview]
Message-ID: <20260708112603.9532D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708-ccaione-genio-serial-aliases-v1-2-bf22229e9383@baylibre.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Runtime PM APIs are invoked from the UART PM callback before runtime PM is enabled, causing circular dependencies during probe.
--
--- Patch [2]: [PATCH 2/2] serial: 8250_mtk: honor DT serial aliases ---
commit 74b06e9bc5c00de637cbaa988a6208e3815ff355
Author: Carlo Caione <ccaione@baylibre.com>
serial: 8250_mtk: honor DT serial aliases
The Genio board DTs provide serial aliases for all enabled UARTs, but
the MTK 8250 driver still registered every port with the default line
number. If uart0 deferred and another UART probed first, the 8250 core
could still assign ttyS0 to the wrong port despite the DT aliases.
Read the serial alias during OF probe and seed uart.port.line before
registering the port so the 8250 core reserves the requested ttyS slot.
> diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
> index e6a56cf54ae0c..841d64f6a7071 100644
> --- a/drivers/tty/serial/8250/8250_mtk.c
> +++ b/drivers/tty/serial/8250/8250_mtk.c
[ ... ]
> @@ -575,6 +576,10 @@ static int mtk8250_probe(struct platform_device *pdev)
> #endif
>
> if (is_of_node(fwnode)) {
> + line = of_alias_get_id(pdev->dev.of_node, "serial");
> + if (line >= 0)
> + uart.port.line = line;
> +
> /* Disable Rate Fix function */
> writel(0x0, uart.port.membase +
> (MTK_UART_RATE_FIX << uart.port.regshift));
[Severity: High]
This isn't a bug introduced by this patch, but registering the 8250 port
before enabling runtime PM causes circular dependencies during device probe.
During port registration, the serial core can synchronously invoke the port's
.pm callback (mtk8250_do_pm()). The mtk8250_do_pm() callback executes
pm_runtime_get_sync() and pm_runtime_put_sync_suspend() on an uninitialized
device:
drivers/tty/serial/8250/8250_mtk.c:mtk8250_do_pm() {
...
if (!state)
pm_runtime_get_sync(port->dev);
...
}
This happens further down in mtk8250_probe():
drivers/tty/serial/8250/8250_mtk.c:mtk8250_probe() {
...
data->line = serial8250_register_8250_port(&uart);
if (data->line < 0)
return data->line;
data->rx_wakeup_irq = platform_get_irq_optional(pdev, 1);
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
...
}
Could pm_runtime_enable() be called before serial8250_register_8250_port()
to prevent hung worker threads and indefinitely blocked probe tasks?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708-ccaione-genio-serial-aliases-v1-0-bf22229e9383@baylibre.com?part=2
next prev parent reply other threads:[~2026-07-08 11:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-07-08 12:54 ` Carlo Caione
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=20260708112603.9532D1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ccaione@baylibre.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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