Skip to content

TTY: port hangup and close fixes

Johan Hovold linux-serial lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 10 repliesIn review
  2. v22 of 4 patches 1 replySuperseded
  3. v1 RFC4 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- amend series with fix of DTR sometimes being raised on hang-up
- do not lower DTR on hangup if port tty is gone
- make sure tty in call to shutdown is refcounted
- use cflag-macros throughout

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6TTY: clean up port shutdowndrivers/tty/tty_port.c+7 -20 replies
2/6TTY: wake up processes last at hangupdrivers/tty/tty_port.c+1 -10 replies
3/6TTY: fix DTR being raised on hang updrivers/tty/tty_port.c+1 -15 replies
4/6TTY: fix DTR not being dropped on hang updrivers/tty/mxser.c drivers/tty/n_gsm.c drivers/tty/tty_port.c+23 -120 replies
5/6TTY: clean up port drain-delay handlingdrivers/tty/tty_port.c+16 -110 replies
6/6TTY: fix close of uninitialised portsdrivers/tty/tty_port.c+10 -80 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/6] TTY: port hangup and close fixes

These patches against 3.9-rc1 fix a few issues with tty-port hangup and close.

The first and fifth patch are essentially clean ups.

The second and third patch fix the fact that DTR could get raised (rather than dropped) at hangup if there are blocked opens. [ Note that the second patch has been separated into its own patch and that the third patch is new in v3 of this series. ]

The fourth patch makes sure DTR is dropped also on hangup and that DTR is only dropped for initialised ports (where it could have been raised in the first place).

The sixth and final patch, makes sure no tty callbacks are made from tty_port_close_start when the port has not been initialised (successfully opened). This was previously only done for wait_until_sent but there's no reason to call flush_buffer or to honour port drain delay either. The latter could cause a failed open to stall for up to two seconds.

As a side-effect, these patches also fix an issue in USB-serial where we could get tty-port callbacks on an uninitialised port after having hung up and unregistered a device after disconnect.

Johan

v3:
- amend series with fix of DTR sometimes being raised on hang-up
- do not lower DTR on hangup if port tty is gone
- make sure tty in call to shutdown is refcounted
- use cflag-macros throughout

v2:
- reuse tty reference from hangup and close in shutdown. Both call sites guarantee tty is either NULL or has a kref.

Changes since RFC-series:
- fix up the two driver relying on tty_port_close_start directly but that did not manage DTR themselves

Johan Hovold (6):
TTY: clean up port shutdown
TTY: wake up processes last at hangup
TTY: fix DTR being raised on hang up
TTY: fix DTR not being dropped on hang up
TTY: clean up port drain-delay handling
TTY: fix close of uninitialised ports

 drivers/tty/mxser.c    |  4 +++
 drivers/tty/n_gsm.c    |  4 +++
 drivers/tty/tty_port.c | 77 ++++++++++++++++++++++++++++++--------------------
 3 files changed, 54 insertions(+), 31 deletions(-)
Signature · 6 lines
1.8.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html