[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160820142226.6121e76d@lxorguk.ukuu.org.uk>
Date: Sat, 20 Aug 2016 14:22:26 +0100
From: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To: "H. Nikolaus Schaller" <hns@...delico.com>
Cc: Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Marcel Holtmann <marcel@...tmann.org>,
Jiri Slaby <jslaby@...e.com>, Pavel Machek <pavel@....cz>,
Peter Hurley <peter@...leysoftware.com>,
NeilBrown <neil@...wn.name>, Arnd Bergmann <arnd@...db.de>,
Linus Walleij <linus.walleij@...aro.org>,
"open list:BLUETOOTH DRIVERS" <linux-bluetooth@...r.kernel.org>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 0/3] UART slave device bus
On Fri, 19 Aug 2016 19:42:37 +0200
"H. Nikolaus Schaller" <hns@...delico.com> wrote:
> > Am 19.08.2016 um 13:06 schrieb One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>:
> >
> >> If possible, please do a callback for every character that arrives.
> >> And not only if the rx buffer becomes full, to give the slave driver
> >> a chance to trigger actions almost immediately after every character.
> >> This probably runs in interrupt context and can happen often.
> >
> > We don't realistically have the clock cycles to do that on a low end
> > embedded processor handling high speed I/O.
>
> well, if we have a low end embedded processor and high-speed I/O, then
> buffering the data before processing doesn't help either since processing
> still will eat up clock cycles.
Of course it helps. You are out of the IRQ handler within the 9 serial
clocks, so you can take another interrupt and grab the next byte. You
will also get benefits from processing the bytes further in blocks, and
if you get too far behind you'll make the flow control limit.
You've also usually got multiple cores these days - although not on the
very low end quite often.
> The question is if this is needed at all. If we have a bluetooth stack with HCI the
> fastest UART interface I am aware of is running at 3 Mbit/s. 10 bits incl. framing
> means 300kByte/s equiv. 3µs per byte to process. Should be enough to decide
> if the byte should go to a buffer or not, check checksums, or discard and move
> the protocol engine to a different state. This is what I assume would be done in
> a callback. No processing needing some ms per frame.
That depends on the processor - remember people run Linux on low end CPUs
including those embedded in an FPGA not just high end PC and ARM class
devices.
The more important question is - purely for the receive side of things -
is a callback which guarantees to be called "soon" after the bytes arrive
sufficient.
If it is then almost no work is needed on the receive side to allow pure
kernel code to manage recevied data directly because the current
buffering support throughout the receive side is completely capable of
providing those services without a tty structure, and to anything which
can have a tty attached.
Doesn't solve transmit or configuration but it's one step that needs no
additional real work and re-invention.
Alan
Powered by blists - more mailing lists