Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305841

Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits)

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits)
Date 2016-01-11 05:50 +0100
Message-ID <qPCAy-5OS-9@gated-at.bofh.it> (permalink)
References <qPw26-1mc-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Jan 10, 2016 at 01:42:44PM -0800, Peter Hurley wrote:
> The tty/serial core uses 5 bits in the tty_port.flags field to
> manage state. They are:
> 
> ASYNCB_INITIALIZED
> ASYNCB_SUSPENDED
> ASYNCB_NORMAL_ACTIVE
> - and -
> ASYNCB_CTS_FLOW
> ASYNCB_CHECK_CD
> 
> Unfortunately, updates to this field (tty_port.flags) are often
> non-atomic. Additionally, the field is visible to/modifiable by
> userspace (the first 3 bits above are not modifiable by userspace
> though). Lastly, the multi-bit ASYNC_SPD_ bitfield is in this
> tty_port.flags field as well.
> 
> What needs to happen is the tty/serial core needs to update its
> state transitions atomically. I want to re-define the above 5 flags
> into a separate field in the tty_port structure and designate new
> symbols for these bits. The base patch that does this is inlined
> below.
> 
> This will break out-of-tree drivers but I don't really see a
> realistic alternative. Also, I think the new symbol prefix ASY_ isn't
> great and I'd like to get some suggestions.

Don't worry about breaking out-of-tree drivers, that's fine.

And try "hiding" the symbol prefix behind inline functions
(tty_port_initialized(port) and the like) that way the prefix of the
symbol, or even how you do this with locking or bits or atomics will all
not matter at all.

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 22:50 +0100
  Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-11 00:50 +0100
  Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) Greg KH <gregkh@linuxfoundation.org> - 2016-01-11 05:50 +0100
    Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 06:20 +0100
    Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) Grant Edwards <grant.b.edwards@gmail.com> - 2016-01-11 17:00 +0100
      Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) Peter Hurley <peter@hurleysoftware.com> - 2016-01-11 17:30 +0100

csiph-web