aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Lindgren <[email protected]>2023-10-23 10:48:54 +0300
committerGreg Kroah-Hartman <[email protected]>2023-10-24 11:35:29 +0200
commit6f699743aebf07538e506a46c5965eb8bdd2c716 (patch)
treec3eaea7e09b1b62946ba990781abd574b813ffe9
parentb0eaf27f202813f28af77e33e80ec0f05a34df01 (diff)
serial: core: Fix runtime PM handling for pending tx
Richard reported that a serial port may end up sometimes with tx data pending in the buffer for long periods of time. Turns out we bail out early on any errors from pm_runtime_get(), including -EINPROGRESS. To fix the issue, we need to ignore -EINPROGRESS as we only care about the runtime PM usage count at this point. We check for an active runtime PM state later on for tx. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Cc: stable <[email protected]> Reported-by: Richard Purdie <[email protected]> Cc: Bruce Ashfield <[email protected]> Cc: Mikko Rapeli <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Randy MacLeod <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Tested-by: Richard Purdie <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/tty/serial/serial_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b106eb3943d0..f1348a509552 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -146,7 +146,7 @@ static void __uart_start(struct uart_state *state)
/* Increment the runtime PM usage count for the active check below */
err = pm_runtime_get(&port_dev->dev);
- if (err < 0) {
+ if (err < 0 && err != -EINPROGRESS) {
pm_runtime_put_noidle(&port_dev->dev);
return;
}