linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] amba-pl011: simplify TX handling
Date: Thu, 26 Mar 2015 22:28:37 +0100	[thread overview]
Message-ID: <20150326212837.GA21648@kroah.com> (raw)
In-Reply-To: <1426636967-9124-1-git-send-email-moorray3@wp.pl>

On Wed, Mar 18, 2015 at 01:02:47AM +0100, Jakub Kicinski wrote:
> From: Jakub Kicinski <kubakici@wp.pl>
> 
> Since pre-git era PL011 used an elaborate scheme to load data
> to TX FIFO.  Only TX IRQ handler was loading data into the FIFO,
> which required the IRQ to fire before any transmission started
> (to load the first batch of characters).  Initial IRQ was fired
> by putting UART into loopback mode and writing an arbitrary
> character during .startup().
> 
> Unfortunately some PL011-compatible UART (most notably BCM2708
> in Raspberry Pi) would transmit the arbitrary character even
> though the device was in loopback mode.  Commit 734745caeb9f
> ("serial/amba-pl011: Activate TX IRQ passively") solved this
> issue by loading the first batch explicitly from .start_tx()
> handler.  It employed quite a complex scheme involving IRQ
> counting and a delayed work.
> 
> f2ee6dfa0e85 ("serial/amba-pl011: Leave the TX IRQ alone when
> the UART is not open") was an attempt to optimise the loading
> by assuming that when the device is opened second time TX IRQ
> from the previous transmission will still be pending.  This
> assumption is incorrect if the device is closed with FIFO full
> because FIFO will be programmatically flushed and therefore no
> IRQ will be pending on next .open().
> 
> This patch simplifies the code and fixes above problem. It should
> also make things a bit more efficient as the FIFO was not filled
> properly after the driver seen more than two IRQs.
> 
> Fixes: f2ee6dfa0e85 ("serial/amba-pl011: Leave the TX IRQ alone when the UART is not open")
> Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
> ---
> v2:
>  - don't try to load FIFO from outside of IRQ handler
>    if IRQ is unmasked (change to pl011_start_tx_pio());
>  - don't check for FIFO_FULL at the end of load from IRQ;
>  - remove unnecessary newlines.
> ---
>  drivers/tty/serial/amba-pl011.c | 113 +++++++++++++---------------------------
>  1 file changed, 35 insertions(+), 78 deletions(-)

As I think this does much the same thing Dave Martin's patch does, I
want him to ack this before I can accept it.

thanks,

greg k-h

      reply	other threads:[~2015-03-26 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  0:02 [PATCH v2] amba-pl011: simplify TX handling Jakub Kicinski
2015-03-26 21:28 ` Greg Kroah-Hartman [this message]

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=20150326212837.GA21648@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.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).