From: Bhupinder Thakur <bhupinder.thakur@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Andre Przywara <andre.przywara@arm.com>,
Julien Grall <julien.grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 26/27 v12] arm/xen: vpl011: Fix the slow early console SBSA UART output
Date: Fri, 13 Oct 2017 16:10:30 +0530 [thread overview]
Message-ID: <1507891231-4386-1-git-send-email-bhupinder.thakur@linaro.org> (raw)
The early console output uses pl011_early_write() to write data. This
function waits for BUSY bit to get cleared before writing the next byte.
In the SBSA UART emulation logic, the BUSY bit was set as soon one
byte was written in the FIFO and it remained set until the FIFO was
emptied. This meant that the output was delayed as each character needed
the BUSY to get cleared.
Since the SBSA UART is getting emulated in Xen using ring buffers, it
ensures that once the data is enqueued in the FIFO, it will be received
by xenconsole so it is safe to set the BUSY bit only when FIFO becomes
full. This will ensure that pl011_early_write() is not delayed unduly
to write the data.
Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
---
CC: Julien Grall <julien.grall@arm.com>
CC: Andre Przywara <andre.przywara@arm.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/vpl011.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index f7ddccb..0b07436 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -159,9 +159,15 @@ static void vpl011_write_data(struct domain *d, uint8_t data)
{
vpl011->uartfr |= TXFF;
vpl011->uartris &= ~TXI;
- }
- vpl011->uartfr |= BUSY;
+ /*
+ * This bit is set only when FIFO becomes full. This ensures that
+ * the SBSA UART driver can write the early console data as fast as
+ * possible, without waiting for the BUSY bit to get cleared before
+ * writing each byte.
+ */
+ vpl011->uartfr |= BUSY;
+ }
vpl011->uartfr &= ~TXFE;
@@ -371,11 +377,16 @@ static void vpl011_data_avail(struct domain *d)
{
vpl011->uartfr &= ~TXFF;
vpl011->uartris |= TXI;
+
+ /*
+ * Clear the BUSY bit as soon as space becomes available
+ * so that the SBSA UART driver can start writing more data
+ * without any further delay.
+ */
+ vpl011->uartfr &= ~BUSY;
+
if ( out_ring_qsize == 0 )
- {
- vpl011->uartfr &= ~BUSY;
vpl011->uartfr |= TXFE;
- }
}
vpl011_update_interrupt_status(d);
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next reply other threads:[~2017-10-13 10:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 10:40 Bhupinder Thakur [this message]
2017-10-13 10:40 ` [PATCH 27/27 v12] arm/xen: vpl011: Correct the logic for asserting/de-asserting SBSA UART TX interrupt Bhupinder Thakur
2017-10-13 13:59 ` Dave Martin
2017-10-18 10:26 ` Andre Przywara
2017-10-18 10:47 ` Bhupinder Thakur
2017-10-18 13:41 ` [PATCH RFC] ARM: vPL011: use receive timeout interrupt Andre Przywara
2017-10-18 16:32 ` Bhupinder Thakur
2017-10-23 16:01 ` Andre Przywara
2017-10-24 11:00 ` Julien Grall
2017-10-24 11:27 ` Andre Przywara
2017-10-24 12:56 ` Bhupinder Thakur
2017-10-24 12:56 ` Bhupinder Thakur
2017-10-17 9:51 ` [PATCH 26/27 v12] arm/xen: vpl011: Fix the slow early console SBSA UART output Andre Przywara
2017-10-17 11:19 ` Dave Martin
2017-10-17 12:53 ` Rob Herring
2017-10-17 13:44 ` Dave Martin
2017-10-17 14:03 ` Russell King - ARM Linux
2017-10-17 14:49 ` Dave P Martin
2017-10-18 10:17 ` Bhupinder Thakur
2017-10-18 10:31 ` Andre Przywara
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=1507891231-4386-1-git-send-email-bhupinder.thakur@linaro.org \
--to=bhupinder.thakur@linaro.org \
--cc=andre.przywara@arm.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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).