Skip to content

Commit 05acc8b

Browse files
conghuic23acrnsi
authored andcommitted
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 <conghui.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent ecc472f commit 05acc8b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hypervisor/dm/vuart.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ static void send_to_target(struct acrn_vuart *vu, uint8_t value_u8)
180180
vuart_lock(vu);
181181
if (vu->active) {
182182
fifo_putchar(&vu->rxfifo, (char)value_u8);
183-
vu->thre_int_pending = true;
184183
vuart_toggle_intr(vu);
185184
}
186185
vuart_unlock(vu);
@@ -349,6 +348,10 @@ static bool vuart_write(struct acrn_vm *vm, uint16_t offset_arg,
349348
if (((vu->mcr & MCR_LOOPBACK) == 0U) &&
350349
(offset == UART16550_THR) && (target_vu != NULL)) {
351350
send_to_target(target_vu, value_u8);
351+
vuart_lock(vu);
352+
vu->thre_int_pending = true;
353+
vuart_toggle_intr(vu);
354+
vuart_unlock(vu);
352355
} else {
353356
write_reg(vu, offset, value_u8);
354357
}

0 commit comments

Comments
 (0)