Skip to content

Commit 6f69974

Browse files
tmlindgregkh
authored andcommitted
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: 84a9582 ("serial: core: Start managing serial controllers to enable runtime PM") Cc: stable <stable@kernel.org> Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Bruce Ashfield <bruce.ashfield@gmail.com> Cc: Mikko Rapeli <mikko.rapeli@linaro.org> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Randy MacLeod <randy.macleod@windriver.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Richard Purdie <richard.purdie@linuxfoundation.org> Link: https://lore.kernel.org/r/20231023074856.61896-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b0eaf27 commit 6f69974

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/tty/serial/serial_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static void __uart_start(struct uart_state *state)
146146

147147
/* Increment the runtime PM usage count for the active check below */
148148
err = pm_runtime_get(&port_dev->dev);
149-
if (err < 0) {
149+
if (err < 0 && err != -EINPROGRESS) {
150150
pm_runtime_put_noidle(&port_dev->dev);
151151
return;
152152
}

0 commit comments

Comments
 (0)