From: Peter Hurley <peter@hurleysoftware.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
Linux kernel <linux-kernel@vger.kernel.org>,
Jiri Slaby <jslaby@suse.cz>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Subject: Re: RFC: out-of-tree tty driver breakage (changing ASYNC_ bits)
Date: Sun, 10 Jan 2016 21:16:34 -0800 [thread overview]
Message-ID: <56933AB2.8090305@hurleysoftware.com> (raw)
In-Reply-To: <20160111044204.GB12741@kroah.com>
On 01/10/2016 08:42 PM, Greg KH wrote:
> 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.
Ok, will do. Thanks for the input.
Regards,
Peter Hurley
next prev parent reply other threads:[~2016-01-11 5:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-10 21:42 RFC: out-of-tree tty driver breakage (changing ASYNC_ bits) Peter Hurley
2016-01-10 23:44 ` One Thousand Gnomes
2016-01-11 0:36 ` Peter Hurley
2016-01-11 4:42 ` Greg KH
2016-01-11 5:16 ` Peter Hurley [this message]
2016-01-11 15:53 ` Grant Edwards
2016-01-11 16:24 ` Peter Hurley
2016-06-28 15:39 ` Grant Edwards
2016-06-28 15:54 ` Grant Edwards
2016-06-28 16:05 ` Grant Edwards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56933AB2.8090305@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.