From 05acc8b7052ff2469613462f64e155dbc720bf95 Mon Sep 17 00:00:00 2001 From: Conghui Chen Date: Mon, 15 Jul 2019 14:22:09 +0000 Subject: [PATCH] hv: vuart: bugfix for communication vuart When a VM send data to its communication vuart, the vuart driver should inject a DR interrupt to target VM and also inject a THRE interrupt to self VM. But the original code inject the THRE interrupt to target VM, correct it in this patch. Tracked-On: #3423 Signed-off-by: Conghui Chen Acked-by: Eddie Dong --- hypervisor/dm/vuart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hypervisor/dm/vuart.c b/hypervisor/dm/vuart.c index bd637c359..d3c3a2eb6 100644 --- a/hypervisor/dm/vuart.c +++ b/hypervisor/dm/vuart.c @@ -180,7 +180,6 @@ static void send_to_target(struct acrn_vuart *vu, uint8_t value_u8) vuart_lock(vu); if (vu->active) { fifo_putchar(&vu->rxfifo, (char)value_u8); - vu->thre_int_pending = true; vuart_toggle_intr(vu); } vuart_unlock(vu); @@ -349,6 +348,10 @@ static bool vuart_write(struct acrn_vm *vm, uint16_t offset_arg, if (((vu->mcr & MCR_LOOPBACK) == 0U) && (offset == UART16550_THR) && (target_vu != NULL)) { send_to_target(target_vu, value_u8); + vuart_lock(vu); + vu->thre_int_pending = true; + vuart_toggle_intr(vu); + vuart_unlock(vu); } else { write_reg(vu, offset, value_u8); }