From: Jiawen Liu <liu1298662399@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: [PATCH] serial: 8250_omap: Abort probe on runtime resume failure
Date: Sun, 29 Nov 2026 19:25:33 +0000 [thread overview]
Message-ID: <179598033550.2.3869535799399729825.pattern-ext-056.4@gmail.com> (raw)
On AM335x, a TI sysc module clock timeout can leave the UART's
parent suspended and cause pm_runtime_get_sync() to fail during
probe. The driver ignores the error and reads UART_OMAP_MVER while
the UART is still suspended, which can lead to incorrect
revision-dependent setup.
Return negative resume errors through the existing unwind, which
balances the usage reference acquired by pm_runtime_get_sync().
Disable runtime PM before flushing QoS work so PM callbacks cannot
queue more work after the flush. Undo wakeup setup on probe failure.
Source review, x86-64 driver
object builds with CONFIG_PM enabled and disabled, checkpatch, and
git diff --check passed. No runtime or hardware reproduction was
performed.
Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
drivers/tty/serial/8250/8250_omap.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index ed0b8f1253327..53f9cc29c21ee 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1537,7 +1537,9 @@ static int omap8250_probe(struct platform_device *pdev)
if (!of_get_available_child_count(pdev->dev.of_node))
pm_runtime_set_autosuspend_delay(&pdev->dev, -1);
- pm_runtime_get_sync(&pdev->dev);
+ ret = pm_runtime_get_sync(&pdev->dev);
+ if (ret < 0)
+ goto err;
omap_serial_fill_features_erratas(&up, priv);
up.port.handle_irq = omap8250_no_handle_irq;
@@ -1610,9 +1612,10 @@ static int omap8250_probe(struct platform_device *pdev)
dev_pm_clear_wake_irq(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
- flush_work(&priv->qos_work);
pm_runtime_disable(&pdev->dev);
+ flush_work(&priv->qos_work);
cpu_latency_qos_remove_request(&priv->pm_qos_request);
+ device_init_wakeup(&pdev->dev, false);
return ret;
}
--
2.34.1
next reply other threads:[~2026-11-29 19:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 19:25 Jiawen Liu [this message]
2026-11-29 19:39 ` [PATCH] serial: 8250_omap: Abort probe on runtime resume failure sashiko-bot
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=179598033550.2.3869535799399729825.pattern-ext-056.4@gmail.com \
--to=liu1298662399@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.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