OSDN Git Service

imx_serial: Generate interrupt on tx empty if enabled
authorGuenter Roeck <linux@roeck-us.net>
Thu, 20 Aug 2015 15:52:35 +0000 (08:52 -0700)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 8 Oct 2015 16:46:01 +0000 (19:46 +0300)
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>
Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/char/imx_serial.c

index e8f32c4..f0c4c72 100644 (file)
@@ -66,7 +66,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;
     }