Skip to content

tty contention resulting from tty_open_by_driver export

Okash Khawaja lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 0 repliesNew
  2. v23 patches 8 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tty: resolve tty contention between kernel and user spacedrivers/tty/tty_io.c include/linux/tty.h+116 -50 replies
2/3staging: speakup: use tty_kopen and tty_kclosedrivers/staging/speakup/spk_ttyio.c+2 -20 replies
3/3tty: undo export of tty_open_by_driverdrivers/tty/tty_io.c include/linux/tty.h+1 -70 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/3] tty contention resulting from tty_open_by_driver export

Hi,

I have updated the patches so that the exclusivity flag is in tty_port. When closing the struct - by calling tty_release_struct - we also need to reset the flag. One way to do that is to reset the flag inside tty_release_struct function, regardless of whether the tty was opened through tty_kopen or not. In order to keep the code clean, I have instead created a separate function called tty_kclose which is the same as tty_release_struct except that it also resets the exclusivity flag. As a result, any changes to tty_release_struct won't be in tty_kclose untless manually added. Please advise on this.

Here is a summary of changes when compared to v2:

- Patch 1 uses TTY_PORT_KOPENED flag instead of TTY_KOPENED and as a result adds helper functions to read and change the flag
- Patch 1 adds tty_kclose function to close tty opened by tty_kopen
- Patch 2 calls tty_kclose instead of tty_release_struct

Thanks,
Okash