mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] serial: 8250_omap: Abort probe on runtime resume failure
@ 2026-11-29 19:25 Jiawen Liu
  2026-11-30  2:11 ` Krzysztof Kozlowski
  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	[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-30  2:11 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-30  2:11 UTC (permalink / raw)
  To: Jiawen Liu; +Cc: Jiri Slaby, linux-kernel, linux-serial, Greg Kroah-Hartman


On Sun, 29 Nov 2026 19:25:33 +0000, Jiawen Liu wrote:
> 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(-)
> 

You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.

Best regards,
Krzysztof





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

end of thread, other threads:[~2026-11-30  2:11 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-30  2:11 ` Krzysztof Kozlowski

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

all inboxes | Powered by JetHome®