Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls
@ 2026-10-31 17:09 Joshua Crofts
  2026-10-31 17:09 ` [PATCH 1/5] serial: 8250_omap: remove redunant " Joshua Crofts
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Joshua Crofts @ 2026-10-31 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michal Simek, Peter Korsgaard
  Cc: linux-kernel, linux-serial, linux-arm-kernel, Joshua Crofts

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function calls.

Signed-off-by: Joshua Crofts <crofts@kernel.org>
---
Joshua Crofts (5):
      serial: 8250_omap: remove redunant pm_runtime_dont_use_autosuspend() calls
      serial: fsl_lpuart: remove redundant pm_runtime_dont_use_autosuspend() calls
      serial: xilinx_uartps: remove redundant pm_runtime_dont_use_autosuspend() calls
      serial: port: remove redundant pm_runtime_dont_use_autosuspend() calls
      serial: uartlite: remove redundant pm_runtime_dont_use_autosuspend() calls

 drivers/tty/serial/8250/8250_omap.c | 2 --
 drivers/tty/serial/fsl_lpuart.c     | 2 --
 drivers/tty/serial/serial_port.c    | 1 -
 drivers/tty/serial/uartlite.c       | 1 -
 drivers/tty/serial/xilinx_uartps.c  | 2 --
 5 files changed, 8 deletions(-)
---
base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e
change-id: 20261031-tty-dont-use-autosuspend-removal-e821bc1ec476

Best regards,
-- 
Joshua Crofts


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

* [PATCH 1/5] serial: 8250_omap: remove redunant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls Joshua Crofts
@ 2026-10-31 17:09 ` Joshua Crofts
  2026-10-31 17:16   ` sashiko-bot
  2026-10-31 17:09 ` [PATCH 2/5] serial: fsl_lpuart: remove redundant " Joshua Crofts
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Joshua Crofts @ 2026-10-31 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michal Simek, Peter Korsgaard
  Cc: linux-kernel, linux-serial, linux-arm-kernel, Joshua Crofts

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function calls.

Signed-off-by: Joshua Crofts <crofts@kernel.org>
---
 drivers/tty/serial/8250/8250_omap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 29a203ed93fd..5d6911b1a2b0 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1608,7 +1608,6 @@ static int omap8250_probe(struct platform_device *pdev)
 	return 0;
 err:
 	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);
@@ -1631,7 +1630,6 @@ static void omap8250_remove(struct platform_device *pdev)
 	serial8250_unregister_port(up);
 	priv->uport = NULL;
 	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);

-- 
2.56.0


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

* [PATCH 2/5] serial: fsl_lpuart: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls Joshua Crofts
  2026-10-31 17:09 ` [PATCH 1/5] serial: 8250_omap: remove redunant " Joshua Crofts
@ 2026-10-31 17:09 ` Joshua Crofts
  2026-10-31 17:17   ` sashiko-bot
  2026-10-31 17:09 ` [PATCH 3/5] serial: xilinx_uartps: " Joshua Crofts
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Joshua Crofts @ 2026-10-31 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michal Simek, Peter Korsgaard
  Cc: linux-kernel, linux-serial, linux-arm-kernel, Joshua Crofts

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function calls.

Signed-off-by: Joshua Crofts <crofts@kernel.org>
---
 drivers/tty/serial/fsl_lpuart.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index c8575c965203..411e14151a50 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2987,7 +2987,6 @@ static int lpuart_probe(struct platform_device *pdev)
 failed_reset:
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	lpuart_disable_clks(sport);
 	return ret;
 }
@@ -3008,7 +3007,6 @@ static void lpuart_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 }
 
 static int lpuart_runtime_suspend(struct device *dev)

-- 
2.56.0


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

* [PATCH 3/5] serial: xilinx_uartps: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls Joshua Crofts
  2026-10-31 17:09 ` [PATCH 1/5] serial: 8250_omap: remove redunant " Joshua Crofts
  2026-10-31 17:09 ` [PATCH 2/5] serial: fsl_lpuart: remove redundant " Joshua Crofts
@ 2026-10-31 17:09 ` Joshua Crofts
  2026-10-31 17:20   ` sashiko-bot
  2026-10-31 17:09 ` [PATCH 4/5] serial: port: " Joshua Crofts
  2026-10-31 17:09 ` [PATCH 5/5] serial: uartlite: " Joshua Crofts
  4 siblings, 1 reply; 11+ messages in thread
From: Joshua Crofts @ 2026-10-31 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michal Simek, Peter Korsgaard
  Cc: linux-kernel, linux-serial, linux-arm-kernel, Joshua Crofts

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function calls.

Signed-off-by: Joshua Crofts <crofts@kernel.org>
---
 drivers/tty/serial/xilinx_uartps.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index a072b75dbaf2..5901517cce5a 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1844,7 +1844,6 @@ static int cdns_uart_probe(struct platform_device *pdev)
 err_out_pm_disable:
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 err_out_clk_notifier:
 #ifdef CONFIG_COMMON_CLK
 	clk_notifier_unregister(cdns_uart_data->uartclk,
@@ -1880,7 +1879,6 @@ static void cdns_uart_remove(struct platform_device *pdev)
 	clk_disable_unprepare(cdns_uart_data->pclk);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	device_init_wakeup(&pdev->dev, false);
 
 #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE

-- 
2.56.0


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

* [PATCH 4/5] serial: port: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls Joshua Crofts
                   ` (2 preceding siblings ...)
  2026-10-31 17:09 ` [PATCH 3/5] serial: xilinx_uartps: " Joshua Crofts
@ 2026-10-31 17:09 ` Joshua Crofts
  2026-10-31 17:15   ` sashiko-bot
  2026-10-31 17:09 ` [PATCH 5/5] serial: uartlite: " Joshua Crofts
  4 siblings, 1 reply; 11+ messages in thread
From: Joshua Crofts @ 2026-10-31 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michal Simek, Peter Korsgaard
  Cc: linux-kernel, linux-serial, linux-arm-kernel, Joshua Crofts

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function call.

Signed-off-by: Joshua Crofts <crofts@kernel.org>
---
 drivers/tty/serial/serial_port.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c
index 2fc48cd63f6c..c6243b8fd58a 100644
--- a/drivers/tty/serial/serial_port.c
+++ b/drivers/tty/serial/serial_port.c
@@ -128,7 +128,6 @@ static int serial_port_probe(struct device *dev)
 
 static int serial_port_remove(struct device *dev)
 {
-	pm_runtime_dont_use_autosuspend(dev);
 	pm_runtime_disable(dev);
 
 	return 0;

-- 
2.56.0


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

* [PATCH 5/5] serial: uartlite: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls Joshua Crofts
                   ` (3 preceding siblings ...)
  2026-10-31 17:09 ` [PATCH 4/5] serial: port: " Joshua Crofts
@ 2026-10-31 17:09 ` Joshua Crofts
  2026-10-31 17:17   ` sashiko-bot
  4 siblings, 1 reply; 11+ messages in thread
From: Joshua Crofts @ 2026-10-31 17:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michal Simek, Peter Korsgaard
  Cc: linux-kernel, linux-serial, linux-arm-kernel, Joshua Crofts

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function call.

Signed-off-by: Joshua Crofts <crofts@kernel.org>
---
 drivers/tty/serial/uartlite.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 6240c3d4dfd7..e7e2fd2b7c59 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -898,7 +898,6 @@ static void ulite_remove(struct platform_device *pdev)
 	ulite_release(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 }
 
 /* work with hotplug and coldplug */

-- 
2.56.0


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

* Re: [PATCH 4/5] serial: port: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 ` [PATCH 4/5] serial: port: " Joshua Crofts
@ 2026-10-31 17:15   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-31 17:15 UTC (permalink / raw)
  To: Joshua Crofts; +Cc: linux-serial

> Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
> driver core is now responsible for undoing any
> pm_runtime_use_autosuspend() calls on driver exit.
> 
> Remove the redundant function call.
> 
> Signed-off-by: Joshua Crofts <crofts@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031-tty-dont-use-autosuspend-removal-v1-0-7bdadcadc4dd@kernel.org?part=4


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

* Re: [PATCH 1/5] serial: 8250_omap: remove redunant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 ` [PATCH 1/5] serial: 8250_omap: remove redunant " Joshua Crofts
@ 2026-10-31 17:16   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-31 17:16 UTC (permalink / raw)
  To: Joshua Crofts; +Cc: linux-serial

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] serial: 8250_omap: broken runtime suspend in probe error and omap8250_remove()
--

commit 651c75542e46afc26bfbf0ef6592eb505fec5ccc
Author: Joshua Crofts <crofts@kernel.org>

serial: 8250_omap: remove redunant pm_runtime_dont_use_autosuspend() calls

This commit removes the explicit pm_runtime_dont_use_autosuspend() calls
from the error path in omap8250_probe() and from omap8250_remove(),
relying on pm_runtime_reinit() in the driver core to clean up autosuspend
state after driver exit.

> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index 29a203ed93fd8..5d6911b1a2b00 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -1608,7 +1608,6 @@ static int omap8250_probe(struct platform_device *pdev)
>  	return 0;
>  err:
>  	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);
> @@ -1631,7 +1630,6 @@ static void omap8250_remove(struct platform_device *pdev)
>  	serial8250_unregister_port(up);
>  	priv->uport = NULL;
>  	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);

[Severity: High]
Does removing pm_runtime_dont_use_autosuspend() before
pm_runtime_put_sync() and pm_runtime_disable() here prevent the device
from runtime suspending on probe failure and in omap8250_remove()?

In omap8250_probe(), the driver enables autosuspend and sets a negative
autosuspend delay when no serdev child nodes are present:

	pm_runtime_enable(&pdev->dev);
	pm_runtime_use_autosuspend(&pdev->dev);
	...
	if (!of_get_available_child_count(pdev->dev.of_node))
		pm_runtime_set_autosuspend_delay(&pdev->dev, -1);

	pm_runtime_get_sync(&pdev->dev);

When power.use_autosuspend is set and power.autosuspend_delay is negative,
update_autosuspend() increments dev->power.usage_count to prevent runtime
suspend. Together with pm_runtime_get_sync() in omap8250_probe() (or
pm_runtime_resume_and_get() in omap8250_remove()), usage_count is 2 when
reaching the teardown path.

Without calling pm_runtime_dont_use_autosuspend(&pdev->dev) first,
pm_runtime_put_sync(&pdev->dev) only drops usage_count from 2 to 1 (or, if
autosuspend_delay is non-negative, schedules the autosuspend timer via
rpm_idle() -> rpm_suspend(dev, RPM_GET_PUT | RPM_AUTO) instead of
synchronously suspending).

The subsequent pm_runtime_disable(&pdev->dev) then cancels any pending
timer and disables runtime PM while the device is still active, without
running omap8250_runtime_suspend() or the PM domain runtime_suspend
callbacks. When the driver core later runs device_unbind_cleanup() ->
pm_runtime_reinit(), runtime PM is already disabled, so pm_runtime_reinit()
only forces the software state to RPM_SUSPENDED via
pm_runtime_set_suspended() and clears use_autosuspend without suspending
the hardware.

On omap_device platforms, leaving the hardware enabled across a failed
probe (such as -EPROBE_DEFER) or driver unbind also causes the next probe
to fail in omap_device_enable() with -EINVAL because the omap_device is
still in OMAP_DEVICE_STATE_ENABLED, which appears to reintroduce the
regression previously fixed by commit 4e0f5cc65098 ("serial: 8250_omap:
Fixdevicealreadyenabled wait loop on deferred probe").

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031-tty-dont-use-autosuspend-removal-v1-0-7bdadcadc4dd@kernel.org?part=1

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

* Re: [PATCH 2/5] serial: fsl_lpuart: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 ` [PATCH 2/5] serial: fsl_lpuart: remove redundant " Joshua Crofts
@ 2026-10-31 17:17   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-31 17:17 UTC (permalink / raw)
  To: Joshua Crofts; +Cc: linux-serial

> Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
> driver core is now responsible for undoing any
> pm_runtime_use_autosuspend() calls on driver exit.
> 
> Remove the redundant function calls.
> 
> Signed-off-by: Joshua Crofts <crofts@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031-tty-dont-use-autosuspend-removal-v1-0-7bdadcadc4dd@kernel.org?part=2


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

* Re: [PATCH 5/5] serial: uartlite: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 ` [PATCH 5/5] serial: uartlite: " Joshua Crofts
@ 2026-10-31 17:17   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-31 17:17 UTC (permalink / raw)
  To: Joshua Crofts; +Cc: linux-serial

> Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
> driver core is now responsible for undoing any
> pm_runtime_use_autosuspend() calls on driver exit.
> 
> Remove the redundant function call.
> 
> Signed-off-by: Joshua Crofts <crofts@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031-tty-dont-use-autosuspend-removal-v1-0-7bdadcadc4dd@kernel.org?part=5


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

* Re: [PATCH 3/5] serial: xilinx_uartps: remove redundant pm_runtime_dont_use_autosuspend() calls
  2026-10-31 17:09 ` [PATCH 3/5] serial: xilinx_uartps: " Joshua Crofts
@ 2026-10-31 17:20   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-31 17:20 UTC (permalink / raw)
  To: Joshua Crofts; +Cc: linux-serial

> Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"),
> driver core is now responsible for undoing any
> pm_runtime_use_autosuspend() calls on driver exit.
> 
> Remove the redundant function calls.
> 
> Signed-off-by: Joshua Crofts <crofts@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031-tty-dont-use-autosuspend-removal-v1-0-7bdadcadc4dd@kernel.org?part=3


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

end of thread, other threads:[~2026-10-31 17:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-31 17:09 [PATCH 0/5] tty: serial: remove redundant pm_runtime_dont_use_autosuspend() calls Joshua Crofts
2026-10-31 17:09 ` [PATCH 1/5] serial: 8250_omap: remove redunant " Joshua Crofts
2026-10-31 17:16   ` sashiko-bot
2026-10-31 17:09 ` [PATCH 2/5] serial: fsl_lpuart: remove redundant " Joshua Crofts
2026-10-31 17:17   ` sashiko-bot
2026-10-31 17:09 ` [PATCH 3/5] serial: xilinx_uartps: " Joshua Crofts
2026-10-31 17:20   ` sashiko-bot
2026-10-31 17:09 ` [PATCH 4/5] serial: port: " Joshua Crofts
2026-10-31 17:15   ` sashiko-bot
2026-10-31 17:09 ` [PATCH 5/5] serial: uartlite: " Joshua Crofts
2026-10-31 17:17   ` sashiko-bot

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