qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled
@ 2015-08-20 15:52 Guenter Roeck
  2015-09-11  7:37 ` Michael Tokarev
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2015-08-20 15:52 UTC (permalink / raw)
  To: Peter Chubb; +Cc: qemu-trivial, qemu-devel, Guenter Roeck

Generate an interrupt if the tx buffer is empty and the tx empty interrupt
is enabled. This fixes a problem seen when running a Linux image since
Linux commit 55c3cb1358e ("serial: imx: remove unneeded imx_transmit_buffer()
from imx_start_tx()"). Linux now waits for the tx empty interrupt before
starting to send data, causing transmit stalls until there is an interrupt
for another reason.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 hw/char/imx_serial.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index f3fbc77..8dc791d 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -145,7 +145,9 @@ static void imx_update(IMXSerialState *s)
     uint32_t flags;
 
     flags = (s->usr1 & s->ucr1) & (USR1_TRDY|USR1_RRDY);
-    if (!(s->ucr1 & UCR1_TXMPTYEN)) {
+    if (s->ucr1 & UCR1_TXMPTYEN) {
+        flags |= (s->uts1 & UTS1_TXEMPTY);
+    } else {
         flags &= ~USR1_TRDY;
     }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-16 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 15:52 [Qemu-devel] [PATCH] imx_serial: Generate interrupt on tx empty if enabled Guenter Roeck
2015-09-11  7:37 ` Michael Tokarev
2015-09-13 20:17   ` Peter Crosthwaite
2015-09-16 10:28     ` Michael Tokarev

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).