From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Dave Martin <Dave.Martin@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>,
Andre Przywara <Andre.Przywara@arm.com>,
Andrew Jackson <Andrew.Jackson@arm.com>,
Graeme Gregory <gg@slimlogic.co.uk>,
linux-serial@vger.kernel.org, popcorn mix <popcornmix@gmail.com>,
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] serial/amba-pl011: Activate TX IRQ passively
Date: Thu, 26 Mar 2015 22:27:27 +0100 [thread overview]
Message-ID: <20150326212727.GA21598@kroah.com> (raw)
In-Reply-To: <1426262182-2298-2-git-send-email-Dave.Martin@arm.com>
On Fri, Mar 13, 2015 at 03:56:21PM +0000, Dave Martin wrote:
> The current PL011 driver transmits a dummy character when the UART
> is opened, to assert the TX IRQ for the first time
> (see pl011_startup()). The UART is put in loopback mode temporarily,
> so the receiver presumably shouldn't see anything.
>
> However...
>
> At least some platforms containing a PL011 send characters down the
> wire even when loopback mode is enabled. This means that a
> spurious NUL character may be seen at the receiver when the PL011 is
> opened through the TTY layer.
>
> The current code also temporarily sets the baud rate to maximum and
> the character width to the minimum, to that the dummy TX completes
> as quickly as possible. If this is seen by the receiver it will
> result in a framing error and can knock the receiver out of sync --
> turning subsequent output into garbage until synchronisation
> is reestablished. (Particularly problematic during boot with systemd.)
>
> To avoid spurious transmissions, this patch removes assumptions about
> whether the TX IRQ will fire until at least one TX IRQ has been seen.
>
> Instead, the UART will unmask the TX IRQ and then slow-start via
> polling and timer-based soft IRQs initially. If the TTY layer writes
> enough data to fill the FIFO to the interrupt threshold in one go,
> the TX IRQ should assert, at which point the driver changes to
> fully interrupt-driven TX.
>
> This should also mean that the driver works on the SBSA Generic
> UART[1] (a cut-down PL011) without invasive changes. The Generic
> UART lacks some features needed for the dummy TX approach to work
> (FIFO disabling and loopback).
>
> [1] Server Base System Architecture (ARM-DEN-0029-v2.3)
> http://infocenter.arm.com/
> (click-thru required :/)
>
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>
> ---
> drivers/tty/serial/amba-pl011.c | 121 +++++++++++++++++++++++++--------------
> 1 file changed, 78 insertions(+), 43 deletions(-)
Wait, I already took this patch, right?
Was there some difference here with this version?
confused,
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] serial/amba-pl011: Activate TX IRQ passively
Date: Thu, 26 Mar 2015 22:27:27 +0100 [thread overview]
Message-ID: <20150326212727.GA21598@kroah.com> (raw)
In-Reply-To: <1426262182-2298-2-git-send-email-Dave.Martin@arm.com>
On Fri, Mar 13, 2015 at 03:56:21PM +0000, Dave Martin wrote:
> The current PL011 driver transmits a dummy character when the UART
> is opened, to assert the TX IRQ for the first time
> (see pl011_startup()). The UART is put in loopback mode temporarily,
> so the receiver presumably shouldn't see anything.
>
> However...
>
> At least some platforms containing a PL011 send characters down the
> wire even when loopback mode is enabled. This means that a
> spurious NUL character may be seen at the receiver when the PL011 is
> opened through the TTY layer.
>
> The current code also temporarily sets the baud rate to maximum and
> the character width to the minimum, to that the dummy TX completes
> as quickly as possible. If this is seen by the receiver it will
> result in a framing error and can knock the receiver out of sync --
> turning subsequent output into garbage until synchronisation
> is reestablished. (Particularly problematic during boot with systemd.)
>
> To avoid spurious transmissions, this patch removes assumptions about
> whether the TX IRQ will fire until at least one TX IRQ has been seen.
>
> Instead, the UART will unmask the TX IRQ and then slow-start via
> polling and timer-based soft IRQs initially. If the TTY layer writes
> enough data to fill the FIFO to the interrupt threshold in one go,
> the TX IRQ should assert, at which point the driver changes to
> fully interrupt-driven TX.
>
> This should also mean that the driver works on the SBSA Generic
> UART[1] (a cut-down PL011) without invasive changes. The Generic
> UART lacks some features needed for the dummy TX approach to work
> (FIFO disabling and loopback).
>
> [1] Server Base System Architecture (ARM-DEN-0029-v2.3)
> http://infocenter.arm.com/
> (click-thru required :/)
>
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>
> ---
> drivers/tty/serial/amba-pl011.c | 121 +++++++++++++++++++++++++--------------
> 1 file changed, 78 insertions(+), 43 deletions(-)
Wait, I already took this patch, right?
Was there some difference here with this version?
confused,
greg k-h
next prev parent reply other threads:[~2015-03-26 21:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 15:56 [PATCH v2 0/2] serial/amba-pl011: Activate TX IRQ passively Dave Martin
2015-03-13 15:56 ` Dave Martin
2015-03-13 15:56 ` [PATCH v2 1/2] " Dave Martin
2015-03-13 15:56 ` Dave Martin
2015-03-26 21:27 ` Greg Kroah-Hartman [this message]
2015-03-26 21:27 ` Greg Kroah-Hartman
2015-03-13 15:56 ` [PATCH v2 2/2] serial/amba-pl011: Leave the TX IRQ alone when the UART is not open Dave Martin
2015-03-13 15:56 ` Dave Martin
2015-03-26 21:26 ` Greg Kroah-Hartman
2015-03-26 21:26 ` Greg Kroah-Hartman
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=20150326212727.GA21598@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Andre.Przywara@arm.com \
--cc=Andrew.Jackson@arm.com \
--cc=Dave.Martin@arm.com \
--cc=gg@slimlogic.co.uk \
--cc=jorge.ramirez-ortiz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=popcornmix@gmail.com \
/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.