Skip to content

set_ldisc notification fixes

Peter Hurley linux-serial lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5tty: Allow safe access to termios for set_ldisc() handlersdrivers/tty/tty_ldisc.c+4 -10 replies
2/5serial: core: Claim port mutex for set_ldisc()drivers/tty/serial/serial_core.c+4 -10 replies
3/5serial: core: Pass termios to set_ldisc() notificationsdrivers/tty/serial/8250/8250_core.c drivers/tty/serial/amba-pl010.c drivers/tty/serial/atmel_serial.c +4 more+14 -120 replies
4/5serial: Take uart port lock for direct *_enable_ms()drivers/tty/serial/8250/8250_core.c drivers/tty/serial/amba-pl010.c drivers/tty/serial/atmel_serial.c+6 -00 replies
5/5serial: Test/disable MSIs if switching from N_PPSdrivers/tty/serial/8250/8250_core.c drivers/tty/serial/amba-pl010.c drivers/tty/serial/atmel_serial.c+42 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH -next 0/5] set_ldisc notification fixes

Hi Greg,

This patch series fixes several locking and functional problems with the .set_ldisc() notification sent by the tty core:
1) termios is used without holding termios_rwsem
2) uart port flags are changed without holding port mutex
3) several of the drivers call their enable_ms() routines directly without holding port lock
4) The set_ldisc notification will turn on modem status interrupts if the CD line is being used for N_PPS time signal, but doesn't turn modem status interrupts back off if N_PPS is being unset.

Note: this series depends on the 26-patch 'tty locking changes' series and the 10-patch 'serial core fixes' series.

Regards,

Peter Hurley (5):
tty: Allow safe access to termios for set_ldisc() handlers
serial: core: Claim port mutex for set_ldisc()
serial: core: Pass termios to set_ldisc() notifications
serial: Take uart port lock for direct *_enable_ms()
serial: Test/disable MSIs if switching from N_PPS

 drivers/tty/serial/8250/8250_core.c | 27 ++++++++++++++++++++++++---
 drivers/tty/serial/amba-pl010.c     | 24 +++++++++++++++++++++---
 drivers/tty/serial/atmel_serial.c   | 11 +++++++++--
 drivers/tty/serial/bfin_uart.c      |  5 +++--
 drivers/tty/serial/clps711x.c       |  5 +++--
 drivers/tty/serial/serial_core.c    |  7 +++++--
 drivers/tty/tty_ldisc.c             |  5 ++++-
 include/linux/serial_core.h         |  2 +-
 8 files changed, 70 insertions(+), 16 deletions(-)
Signature · 1 line
2.1.3