Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] serial: 8250_omap: Abort probe on runtime resume failure
@ 2026-11-29 19:25 Jiawen Liu
  2026-11-29 19:39 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 19:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: linux-kernel, linux-serial

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: 8250_omap: Abort probe on runtime resume failure
  2026-11-29 19:25 [PATCH] serial: 8250_omap: Abort probe on runtime resume failure Jiawen Liu
@ 2026-11-29 19:39 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-29 19:39 UTC (permalink / raw)
  To: Jiawen Liu; +Cc: linux-serial

> 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>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179598033550.2.3869535799399729825.pattern-ext-056.4@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-29 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 19:25 [PATCH] serial: 8250_omap: Abort probe on runtime resume failure Jiawen Liu
2026-11-29 19:39 ` sashiko-bot

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