Skip to content

Commit

Permalink
serial: core: Fix runtime PM handling for pending tx
Browse files Browse the repository at this point in the history
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 <[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]>
  • Loading branch information
tmlind authored and gregkh committed Oct 24, 2023
1 parent b0eaf27 commit 6f69974
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6f69974

Please sign in to comment.