We can safely check for both conditions together in the wait callback
which is invoked before a character is emitted.

This enables the removal of the busy callback.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm-common/include/asm/uart-pl011.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/hypervisor/arch/arm-common/include/asm/uart-pl011.h 
b/hypervisor/arch/arm-common/include/asm/uart-pl011.h
index 4ced3c7..1df125d 100644
--- a/hypervisor/arch/arm-common/include/asm/uart-pl011.h
+++ b/hypervisor/arch/arm-common/include/asm/uart-pl011.h
@@ -94,17 +94,11 @@ static void uart_wait(struct uart_chip *chip)
        do {
                flags = mmio_read32(chip->virt_base + UARTFR);
                cpu_relax();
-       } while (flags & UARTFR_TXFF); /* FIFO full */
+       } while (flags & (UARTFR_TXFF | UARTFR_BUSY)); /* FIFO full or busy */
 }
 
 static void uart_busy(struct uart_chip *chip)
 {
-       u32 flags;
-
-       do {
-               flags = mmio_read32(chip->virt_base + UARTFR);
-               cpu_relax();
-       } while (flags & UARTFR_BUSY);
 }
 
 static void uart_write(struct uart_chip *chip, char c)
-- 
2.1.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to