Skip to content

serial: 8250: restart console after suspend

Peter Hurley linux-serial lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7serial: core: Simplify console suspend logic in uart_suspend_port()drivers/tty/serial/serial_core.c+17 -180 replies
2/7serial: 8250: Move UART_BUG_QUOT workarounddrivers/tty/serial/8250/8250_core.c+9 -80 replies
3/7serial: 8250: Refactor LCR computationdrivers/tty/serial/8250/8250_core.c+21 -110 replies
4/7serial: 8250: Refactor divisor programmingdrivers/tty/serial/8250/8250_core.c+48 -390 replies
5/7serial: 8250: Refactor XR17V35X divisor calculationdrivers/tty/serial/8250/8250_core.c+30 -221 reply
6/7serial: 8250: Use canary to restart console after suspenddrivers/tty/serial/8250/8250_core.c include/linux/serial_8250.h+37 -10 replies
7/7serial: 8250: Prevent concurrent updates to shadow registersdrivers/tty/serial/8250/8250_core.c+9 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] serial: 8250: restart console after suspend

Hi Greg,

This series fixes 8250 console resume from system sleep when the console has been powered down, even though consoles aren't suspending (eg., no_console_suspend on the kernel command line).

Patch 1 refactors the overly-complicated fall-through logic for determining if the port should be shutdown.

Patches 2-5 refactor serial8250_do_set_termios() so that the divisor programming can be used to reprogram the divisor when the port has been powered-down during system sleep.

[ Patch 3, "serial: 8250: Refactor LCR computation" is, strictly
speaking, not a required cleanup for this series. However, it will facilitate re-use by the omap_8250 driver.
]

Patch 6 implements the console restart by cribbing from an idea first put forth by Doug Anderson <[email protected]> to use the scratch register to discover the port has been powered-down. This patch implements this restart for all 8250 drivers _except_ omap_8250 (which has a different divisor scheme) and 8250_dw which unfortunately declares itself to be a PORT_8250 type (fixing this in the 8250_dw driver will enable console restart for DW ports).

Patch 7 is a straggler fix which became obvious once all the refactoring cleaned up serial8250_do_set_termios().

Regards,

Peter Hurley (7):
serial: core: Simplify console suspend logic in uart_suspend_port()
serial: 8250: Move UART_BUG_QUOT workaround
serial: 8250: Refactor LCR computation
serial: 8250: Refactor divisor programming
serial: 8250: Refactor XR17V35X divisor calculation
serial: 8250: Use canary to restart console after suspend
serial: 8250: Prevent concurrent updates to shadow registers

 drivers/tty/serial/8250/8250_core.c | 187 ++++++++++++++++++++++++------------
 drivers/tty/serial/serial_core.c    |  35 ++++---
 include/linux/serial_8250.h         |   3 +
 3 files changed, 144 insertions(+), 81 deletions(-)
Signature · 1 line
2.2.2