Commit 49a8042
serial: pl011: Drop redundant DTR/RTS preservation on close/open
Commit d8d8ffa ("amba-pl011: do not disable RTS during shutdown")
amended the PL011 serial driver to leave DTR/RTS polarity untouched on
tty close. That change made sense.
But the commit also added code to save DTR/RTS state to an internal
variable on tty close and restore it on tty open. That part of the
commit makes less sense: The driver has no ->pm() callback, so the uart
remains powered after tty close and automatically preserves register
state, including DTR/RTS.
Saving and restoring registers isn't the job of the ->startup() and
->shutdown() callbacks anyway. Rather, it should happen in ->pm().
Additionally, after pl011_startup() restores the state, the serial core
overrides it in uart_port_dtr_rts() if a baud rate has been set:
tty_port_open()
uart_port_activate()
uart_startup()
uart_port_startup()
pl011_startup() # restores DTR/RTS from uap->old_cr
tty_port_block_til_ready()
tty_port_raise_dtr_rts # if (C_BAUD(tty))
uart_dtr_rts()
uart_port_dtr_rts() # raises DTR/RTS
The serial core also overrides DTR/RTS on tty close in uart_shutdown()
if C_HUPCL(tty) is set. So a user-defined DTR/RTS polarity won't
survive a close/open cycle anyway, unless the user has set the baud rate
to zero and disabled hupcl on the tty.
Bottom line is, the code to save and restore DTR/RTS has no effect.
Remove it.
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/e22089ab49e6e78822c50c8c4db46bf3ee885623.1641129328.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent e368cc6 commit 49a8042
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
| |||
1805 | 1804 | | |
1806 | 1805 | | |
1807 | 1806 | | |
1808 | | - | |
1809 | | - | |
| 1807 | + | |
| 1808 | + | |
1810 | 1809 | | |
1811 | 1810 | | |
1812 | 1811 | | |
| |||
1883 | 1882 | | |
1884 | 1883 | | |
1885 | 1884 | | |
1886 | | - | |
1887 | 1885 | | |
1888 | 1886 | | |
1889 | 1887 | | |
| |||
2699 | 2697 | | |
2700 | 2698 | | |
2701 | 2699 | | |
2702 | | - | |
2703 | 2700 | | |
2704 | 2701 | | |
2705 | 2702 | | |
| |||
0 commit comments