From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-serial@vger.kernel.org
Subject: Re: Is tty->receive_room no longer usable w/ SMP?
Date: Thu, 13 Feb 2014 18:50:01 +0000 (UTC) [thread overview]
Message-ID: <ldj44p$4a0$1@ger.gmane.org> (raw)
In-Reply-To: 52FD0CD5.1050807@hurleysoftware.com
On 2014-02-13, Peter Hurley <peter@hurleysoftware.com> wrote:
>>>> I must be missing something.
>>>
>>> tty_buffer_request_room() returns a buffer suitable for data + flags;
>>> you're just misreading the code.
>>
>> Great!
>>
>> That solves my problem. I can call tty_buffer_request_room(), read
>> the indicated number of chars or char/flag pairs and then depend on
>> being able to call _either_ tty_insert_flip_string() or
>> tty_insert_flip_string_flags() to transfer the data I read.
>
> Yep.
Problem is solved. Or rather more accurately: Problem was imaginary.
>>> I don't mean to be critical but I can't really see that development
>>> model being sustainable.
>>
>> We've been doing it for 20+ years (though I've only been involved for
>> the last 15). We can't beat the Chinese on the price of boards, so we
>> had better beat them on support.
>
> Just trying to be helpful.
I realize that and I appreciate it.
> Please don't take my comments as an attack on either your business
> model or your development processes;
Of course not.
> I don't know enough about either to criticize.
Nonsense, this is the internet!
>>> There's no realistic way to single-source a driver across hundreds of
>>> kernel versions.
>>
>> Maybe not hundreds. Our current drivers only support 2.6.24 and
>> later. We can still support previous driver versions if required for
>> customers running older 2.6 kernels. We officially stopped
>> supporting 2.4 several years ago.
>
> By "support", do you mean "add new features" or "workaround hardware
> bugs"?
Both. "New features" mostly meant support for new models, but there
were also some actual new features and fixes for old ones that didn't
work. For example, it turns out almost nobody on the planet uses
IXANY. It got left out of both our automated and manual regression
testing, and (embarassingly) it took 10+ years for somebody to realize
that it didn't work. And that "somebody" was a customer that still
had 2.4 kenels running in production machines.
>>> [ For my own edification, why is the driver not a serial mini-port? ]
>>
>> I don't know what a serial mini-port is. We recently transitioned
>> two of our drivers from being tty drivers to being serial-core
>> drivers. Is mini-port something different that the serial core?
>
> No, same thing.
Ah, good.
>> For another driver, it's still a tty driver because the serial-core
>> API just didn't fit the device well enough to make it work. One
>> issue I recall is that our driver for that device needs to be able to
>> cause specific error returns for write() calls that are made when the
>> hardware is unavailable (and I think there are different errors
>> depending on why it's unavailable).
>
> And this is the driver that uses tty_flip_* interface directly?
Well, they all do (under some circumstances). AFAICT, the method
provided by serial core is uart_insert_char(). When we initially
moved from tty driver to serial driver, we did everything in the
simplest, most obvious way (e.g. uart_insert_char()). But we moved
away from that for performance reasons. Our hardware is optimized for
transferring data to/from continuous buffers using 32-bit bus cycles
rather than reading/writing characters one at a time. At one point in
history our drivers would use inline assembly to execute a single
machine instruction to write an entire block of tx data to the
hardware or read an entire block of data from the hardware. There
were also some prototypes that did bus-master DMA for rx/tx data, but
that turned out to be more overhead than programmed I/O, and it was
abandoned. Now that CPU speeds have increased so much faster than bus
speeds, the inline assembly is no longer needed, but making a function
call for every rx byte is still enough to use an alarming amount of
CPU time.
--
Grant Edwards grant.b.edwards Yow! I'm reporting for duty
at as a modern person. I want
gmail.com to do the Latin Hustle now!
next prev parent reply other threads:[~2014-02-13 18:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 22:43 Is tty->receive_room no longer usable w/ SMP? Grant Edwards
2014-02-13 1:04 ` Peter Hurley
2014-02-13 2:27 ` Grant Edwards
2014-02-13 3:56 ` Peter Hurley
2014-02-13 5:38 ` Grant Edwards
2014-02-13 15:30 ` Peter Hurley
2014-02-13 17:52 ` Grant Edwards
2014-02-13 18:20 ` Peter Hurley
2014-02-13 18:50 ` Grant Edwards [this message]
2014-02-13 19:09 ` Peter Hurley
2014-02-13 19:46 ` Grant Edwards
2014-02-14 22:31 ` 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='ldj44p$4a0$1@ger.gmane.org' \
--to=grant.b.edwards@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).