• Jiri Slaby's avatar
    TTY: add port -> tty link · 967fab69
    Jiri Slaby authored
    For that purpose we have to temporarily introduce a second tty back
    pointer into tty_port. It is because serial layer, and maybe others,
    still do not use tty_port_tty_set/get. So that we cannot set the
    tty_port->tty to NULL at will now.
    
    Yes, the fix would be to convert whole serial layer and all its users
    to tty_port_tty_set/get. However we are in the process of removing the
    need of tty in most of the call sites, so this would lead to a
    duplicated work.
    
    Instead we have now tty_port->itty (internal tty) which will be used
    only in flush_to_ldisc. For that one it is ensured that itty is valid
    wherever the work is run. IOW, the work is synchronously cancelled
    before we set itty to NULL and also before hangup is processed.
    
    After we need only tty_port and not tty_struct in most code, this
    shall be changed to tty_port_tty_set/get and itty removed completely.
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    Acked-by: default avatarAlan Cox <alan@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    967fab69
pty.c 19.1 KB